diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-16 15:06:57 +0800 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-16 16:42:53 +0100 |
commit | ef06e5d786d4ab56b77d6011754d5816c4448189 (patch) | |
tree | f72b666b7e2fb19d907a679c26f09aa4df5eda4f /editor | |
parent | ec5f5032892c7f062cf2468c6136b5e926c6d4a8 (diff) |
Fix error when opening Inspector's dots menu
When the inspector is empty, opening the "extra resource options" menu
produces a error:
> Condition "current_res.is_null()" is true.
Opening the mneu with no current resource is valid use case, so
`ERR_FAIL_COND` should not be used.
(cherry picked from commit cb0fa0ed7b6b5e953f820a762979d1d35c12b8ee)
Diffstat (limited to 'editor')
-rw-r--r-- | editor/inspector_dock.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index ab061c4d5c..b9efe7d2ea 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -298,8 +298,7 @@ void InspectorDock::_prepare_resource_extra_popup() { popup->set_item_disabled(popup->get_item_index(RESOURCE_EDIT_CLIPBOARD), r.is_null()); Ref<Resource> current_res = _get_current_resource(); - ERR_FAIL_COND(current_res.is_null()); - popup->set_item_disabled(popup->get_item_index(RESOURCE_SHOW_IN_FILESYSTEM), current_res->is_built_in()); + popup->set_item_disabled(popup->get_item_index(RESOURCE_SHOW_IN_FILESYSTEM), current_res.is_null() || current_res->is_built_in()); } Ref<Resource> InspectorDock::_get_current_resource() const { |