summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-21 09:04:55 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-21 09:05:30 +0200
commita735afac950bf4e04efcb606fee9a07c98e2759d (patch)
tree007f76e58016d2bd1891db24afa075019f749106
parentfb5e8b509b859f9e81d7b7c63086fb7e8dae5dd2 (diff)
EditorNode::show_warning displays a console warning instead of failing during project load
Fixes #31522
-rw-r--r--editor/editor_node.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 311f8b295b..b809e0194b 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3828,9 +3828,13 @@ void EditorNode::show_accept(const String &p_text, const String &p_title) {
void EditorNode::show_warning(const String &p_text, const String &p_title) {
- warning->set_text(p_text);
- warning->set_title(p_title);
- warning->popup_centered_minsize();
+ if (warning->is_inside_tree()) {
+ warning->set_text(p_text);
+ warning->set_title(p_title);
+ warning->popup_centered_minsize();
+ } else {
+ WARN_PRINTS(p_title + " " + p_text);
+ }
}
void EditorNode::_copy_warning(const String &p_str) {