From 8f7ea2132b2289eb7e9b37abf27c93ddbdacdde1 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 31 Mar 2024 17:34:13 +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 83f408318..5f4ce4ff5 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1239,7 +1239,10 @@ void EditorAudioBuses::_load_layout() { void EditorAudioBuses::_load_default_layout() { String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout"); - Ref state = ResourceLoader::load(layout_path, "", true); + Ref state; + if (ResourceLoader::exists(layout_path)) { + state = ResourceLoader::load(layout_path, "", true); + } if (state.is_null()) { EditorNode::get_singleton()->show_warning(vformat(TTR("There is no '%s' file."), layout_path)); return;