diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs index 15b90a8b2bfd..1cbed8bbd514 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs @@ -57,7 +57,7 @@ private void RebuildSolution() BuildManager.GenerateEditorScriptMetadata(); - if (!BuildManager.BuildProjectBlocking("Debug", targets: new[] {"Rebuild"})) + if (!BuildManager.BuildProjectBlocking("Debug", targets: new[] { "Rebuild" })) return; // Build failed // Notify running game for hot-reload @@ -76,7 +76,7 @@ private void CleanSolution() if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) return; // No solution to build - BuildManager.BuildProjectBlocking("Debug", targets: new[] {"Clean"}); + BuildManager.BuildProjectBlocking("Debug", targets: new[] { "Clean" }); } private void ViewLogToggled(bool pressed) => BuildOutputView.LogVisible = pressed; @@ -113,10 +113,10 @@ public override void _Ready() RectMinSize = new Vector2(0, 228) * EditorScale; SizeFlagsVertical = (int)SizeFlags.ExpandFill; - var toolBarHBox = new HBoxContainer {SizeFlagsHorizontal = (int)SizeFlags.ExpandFill}; + var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill }; AddChild(toolBarHBox); - buildMenuBtn = new MenuButton {Text = "Build", Icon = GetIcon("Play", "EditorIcons")}; + buildMenuBtn = new MenuButton { Text = "Build", Icon = GetIcon("Play", "EditorIcons") }; toolBarHBox.AddChild(buildMenuBtn); var buildMenu = buildMenuBtn.GetPopup(); @@ -167,10 +167,14 @@ public override void _Notification(int what) { base._Notification(what); - if (what == NotificationThemeChanged) { - buildMenuBtn.Icon = GetIcon("Play", "EditorIcons"); - errorsBtn.Icon = GetIcon("StatusError", "EditorIcons"); - warningsBtn.Icon = GetIcon("NodeWarning", "EditorIcons"); + if (what == NotificationThemeChanged) + { + if (buildMenuBtn != null) + buildMenuBtn.Icon = GetIcon("Play", "EditorIcons"); + if (errorsBtn != null) + errorsBtn.Icon = GetIcon("StatusError", "EditorIcons"); + if (warningsBtn != null) + warningsBtn.Icon = GetIcon("NodeWarning", "EditorIcons"); } } }