浏览代码

Merge pull request #18061 from Chaosus/fixbug

Fix crash when click on any inspector entry that takes Resource
Poommetee Ketson 7 年之前
父节点
当前提交
9acc199bf8
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      editor/property_editor.cpp

+ 6 - 1
editor/property_editor.cpp

@@ -882,7 +882,12 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
 			} else if (hint_text != "") {
 			} else if (hint_text != "") {
 				int idx = 0;
 				int idx = 0;
 
 
-				const Vector<EditorData::CustomType> custom_resources = EditorNode::get_editor_data().get_custom_types()["Resource"];
+				Vector<EditorData::CustomType> custom_resources;
+
+				if (EditorNode::get_editor_data().get_custom_types().has("Resource")) {
+					custom_resources = EditorNode::get_editor_data().get_custom_types()["Resource"];
+				}
+
 				for (int i = 0; i < hint_text.get_slice_count(","); i++) {
 				for (int i = 0; i < hint_text.get_slice_count(","); i++) {
 
 
 					String base = hint_text.get_slice(",", i);
 					String base = hint_text.get_slice(",", i);