瀏覽代碼

Merge pull request #89808 from timothyqiu/ok-i-know

Don't error multiple times when trying to load missing default bus layout
Rémi Verschelde 1 年之前
父節點
當前提交
17665ec6f2
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      editor/editor_audio_buses.cpp

+ 4 - 1
editor/editor_audio_buses.cpp

@@ -1228,7 +1228,10 @@ void EditorAudioBuses::_load_layout() {
 void EditorAudioBuses::_load_default_layout() {
 	String layout_path = GLOBAL_GET("audio/buses/default_bus_layout");
 
-	Ref<AudioBusLayout> state = ResourceLoader::load(layout_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE);
+	Ref<AudioBusLayout> state;
+	if (ResourceLoader::exists(layout_path)) {
+		state = ResourceLoader::load(layout_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE);
+	}
 	if (state.is_null()) {
 		EditorNode::get_singleton()->show_warning(vformat(TTR("There is no '%s' file."), layout_path));
 		return;