diff --git a/DMCompiler/DMCompiler.cs b/DMCompiler/DMCompiler.cs index db3ae21494..fe607caeff 100644 --- a/DMCompiler/DMCompiler.cs +++ b/DMCompiler/DMCompiler.cs @@ -297,7 +297,7 @@ private List ConvertMaps(DMCompiler compiler, List mapPath return maps; } - private string SaveJson(List maps, string interfaceFile, string outputFile, IOpcodeVerifier verifier) { + private string SaveJson(List maps, string? interfaceFile, string outputFile, IOpcodeVerifier verifier) { var jsonRep = DMObjectTree.CreateJsonRepresentation(); var compiledDream = new DreamCompiledJson { Metadata = new DreamCompiledJsonMetadata { Version = verifier.GetOpcodesHash() }, diff --git a/OpenDreamClient/Interface/Prompts/ListPrompt.cs b/OpenDreamClient/Interface/Prompts/ListPrompt.cs index 8be58f7e3c..be3367dc85 100644 --- a/OpenDreamClient/Interface/Prompts/ListPrompt.cs +++ b/OpenDreamClient/Interface/Prompts/ListPrompt.cs @@ -48,7 +48,8 @@ public ListPrompt(string title, string message, string defaultValue, bool canCan private void ItemList_KeyBindDown(GUIBoundKeyEventArgs e) { if (e.Function == EngineKeyFunctions.TextSubmit) { e.Handle(); - ButtonClicked(DefaultButton); + if (DefaultButton != null) + ButtonClicked(DefaultButton); } } } diff --git a/OpenDreamClient/Interface/Prompts/PromptWindow.cs b/OpenDreamClient/Interface/Prompts/PromptWindow.cs index 390c55a2d4..2b6203ab0b 100644 --- a/OpenDreamClient/Interface/Prompts/PromptWindow.cs +++ b/OpenDreamClient/Interface/Prompts/PromptWindow.cs @@ -8,7 +8,7 @@ namespace OpenDreamClient.Interface.Prompts; public abstract class PromptWindow : OSWindow { protected readonly Control InputControl; - protected string DefaultButton; + protected string? DefaultButton; private readonly BoxContainer _buttonPanel; private bool _promptFinished; @@ -57,7 +57,7 @@ protected void CreateButton(string text, bool isDefault) { Children = { new Label { Text = text, Margin = new Thickness(5, 2, 5, 2) } } }; - if (isDefault) + if (isDefault || DefaultButton == null) DefaultButton = text; button.OnPressed += _ => ButtonClicked(text);