From 1ff8e8548be05571e3bbbc3a9f17279b9bcc6e80 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sat, 23 Mar 2024 21:38:43 +0800 Subject: [PATCH] Don't error multiple times when trying to load missing default bus layout --- editor/editor_audio_buses.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index dd5dc14136d2..3117c287dcc4 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1226,7 +1226,10 @@ void EditorAudioBuses::_load_layout() { void EditorAudioBuses::_load_default_layout() { String layout_path = GLOBAL_GET("audio/buses/default_bus_layout"); - Ref state = ResourceLoader::load(layout_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE); + Ref 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;