浏览代码

Prevent crash when creating custom file tooltip

kobewi 1 年之前
父节点
当前提交
ef4c214703
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      editor/filesystem_dock.cpp

+ 1 - 0
editor/filesystem_dock.cpp

@@ -2503,6 +2503,7 @@ Control *FileSystemDock::create_tooltip_for_path(const String &p_path) const {
 		// No tooltip for directory.
 		// No tooltip for directory.
 		return nullptr;
 		return nullptr;
 	}
 	}
+	ERR_FAIL_COND_V(!FileAccess::exists(p_path), nullptr);
 
 
 	const String type = ResourceLoader::get_resource_type(p_path);
 	const String type = ResourceLoader::get_resource_type(p_path);
 	Control *tooltip = EditorResourceTooltipPlugin::make_default_tooltip(p_path);
 	Control *tooltip = EditorResourceTooltipPlugin::make_default_tooltip(p_path);