### Godot version

4.0 Stable

### System information

Windows 11, Nvidia RTX 3070ti, Ryzen 2600. Driver Version: 531.18, Vulkan

### Issue description

Baking a Lightmap on a Scene that isn't Saved and only has the LightmapGi node itself inside crashes the editor.

I'm not sure how to provide Error Logs, because I don't know where to find them.
(There aren't any log files in ```C:\Users\USERNAME\AppData\Roaming\Godot\app_userdata\projectTest```, I'm not sure if the crash logs are saved there though.)

### Steps to reproduce

1: Open a new Scene that is using the LightmapGi as the Base Node (don't save the Scene!)
2: Press the "Bake Lightmaps" button
3: Editor crashes.

### Minimal reproduction project

N/A
ClassDB::bind_method("_bake", &LightmapGIEditorPlugin::_bake);
}
LightmapGIEditorPlugin::LightmapGIEditorPlugin() {
	bake = memnew(Button);
	bake->set_flat(true);
	bake->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Bake"), SNAME("EditorIcons")));
	bake->set_text(TTR("Bake Lightmaps"));
	bake->hide();
	bake->connect("pressed", Callable(this, "_bake"));
	add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
	lightmap = nullptr;
	file_dialog = memnew(EditorFileDialog);
	file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE);
	file_dialog->add_filter("*.lmbake", TTR("LightMap Bake"));
	file_dialog->set_title(TTR("Select lightmap bake file:"));
	file_dialog->connect("file_selected", callable_mp(this, &LightmapGIEditorPlugin::_bake_select_file));
	bake->add_child(file_dialog);
}
LightmapGIEditorPlugin::~LightmapGIEditorPlugin() {
}