浏览代码

Merge pull request #20456 from Paulb23/issue_20429_fix_right_click_crash

Fix crash on doc right click, issue 20429
Rémi Verschelde 7 年之前
父节点
当前提交
cbf85ea743
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      editor/plugins/script_editor_plugin.cpp

+ 7 - 7
editor/plugins/script_editor_plugin.cpp

@@ -2407,14 +2407,14 @@ void ScriptEditor::_make_script_list_context_menu() {
 		context_menu->add_separator();
 		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/copy_path"), FILE_COPY_PATH);
 		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/show_in_file_system"), SHOW_IN_FILE_SYSTEM);
-	}
 
-	Ref<Script> scr = se->get_edited_resource();
-	if (scr != NULL) {
-		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT);
-		if (!scr.is_null() && scr->is_tool()) {
-			context_menu->add_separator();
-			context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN);
+		Ref<Script> scr = se->get_edited_resource();
+		if (scr != NULL) {
+			context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT);
+			if (!scr.is_null() && scr->is_tool()) {
+				context_menu->add_separator();
+				context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN);
+			}
 		}
 	} else {
 		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_file"), FILE_CLOSE);