summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-30 18:15:29 +0100
committerGitHub <noreply@github.com>2019-12-30 18:15:29 +0100
commit870b5ba2dc3d93276df01784a8235c9a27df43bb (patch)
treef93174f2bdc0a4938b61834a659d79b202aaea82 /editor/plugins
parent9c6863e74b0afe92c7e6e305f366ea566b3b364a (diff)
parent9ae39be64fd6ac1b481a0fc0fbccfb211605fcac (diff)
Merge pull request #34695 from timothyqiu/show-in-file-system
Checks script path before show in filesystem
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/script_editor_plugin.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index b809397b95..f8313978c4 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1270,12 +1270,15 @@ void ScriptEditor::_menu_option(int p_option) {
_copy_script_path();
} break;
case SHOW_IN_FILE_SYSTEM: {
- RES script = current->get_edited_resource();
- FileSystemDock *file_system_dock = EditorNode::get_singleton()->get_filesystem_dock();
- file_system_dock->navigate_to_path(script->get_path());
- // Ensure that the FileSystem dock is visible.
- TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control();
- tab_container->set_current_tab(file_system_dock->get_position_in_parent());
+ const RES script = current->get_edited_resource();
+ const String path = script->get_path();
+ if (!path.empty()) {
+ FileSystemDock *file_system_dock = EditorNode::get_singleton()->get_filesystem_dock();
+ file_system_dock->navigate_to_path(path);
+ // Ensure that the FileSystem dock is visible.
+ TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control();
+ tab_container->set_current_tab(file_system_dock->get_position_in_parent());
+ }
} break;
case CLOSE_DOCS: {
_close_docs_tab();