浏览代码

Merge pull request #77751 from gongpha/crash!-lmnode-null-owner

Add null checking when finding a lightmap baking path
Yuri Sizov 2 年之前
父节点
当前提交
300b736074
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/plugins/lightmap_gi_editor_plugin.cpp

+ 1 - 1
editor/plugins/lightmap_gi_editor_plugin.cpp

@@ -79,7 +79,7 @@ void LightmapGIEditorPlugin::_bake_select_file(const String &p_file) {
 		switch (err) {
 		switch (err) {
 			case LightmapGI::BAKE_ERROR_NO_SAVE_PATH: {
 			case LightmapGI::BAKE_ERROR_NO_SAVE_PATH: {
 				String scene_path = lightmap->get_scene_file_path();
 				String scene_path = lightmap->get_scene_file_path();
-				if (scene_path.is_empty()) {
+				if (scene_path.is_empty() && lightmap->get_owner()) {
 					scene_path = lightmap->get_owner()->get_scene_file_path();
 					scene_path = lightmap->get_owner()->get_scene_file_path();
 				}
 				}
 				if (scene_path.is_empty()) {
 				if (scene_path.is_empty()) {