We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b0dc2b4 + 4067d7d commit 3f99c09Copy full SHA for 3f99c09
editor/plugins/theme_editor_preview.cpp
@@ -510,8 +510,15 @@ bool SceneThemeEditorPreview::set_preview_scene(const String &p_path) {
510
}
511
512
Node *instance = loaded_scene->instantiate();
513
- if (!instance || !Object::cast_to<Control>(instance)) {
+
514
+ if (!instance) {
515
+ EditorNode::get_singleton()->show_warning(TTR("Invalid PackedScene resource, could not instantiate it."));
516
+ return false;
517
+ }
518
519
+ if (!Object::cast_to<Control>(instance)) {
520
EditorNode::get_singleton()->show_warning(TTR("Invalid PackedScene resource, must have a Control node at its root."));
521
+ memdelete(instance);
522
return false;
523
524
0 commit comments