diff --git a/src/Ryujinx.HLE/Debugger/Debugger.Rcmd.cs b/src/Ryujinx.HLE/Debugger/Debugger.Rcmd.cs index d2c8cd513..f63817ef3 100644 --- a/src/Ryujinx.HLE/Debugger/Debugger.Rcmd.cs +++ b/src/Ryujinx.HLE/Debugger/Debugger.Rcmd.cs @@ -28,10 +28,9 @@ namespace Ryujinx.HLE.Debugger private static readonly Dictionary> _rcmdDelegates = new(); - [CanBeNull] public static Func FindRcmdDelegate(string command) { - Func searchResult = null; + Func searchResult = _ => $"Unknown command: {command}\n"; foreach ((string[] names, Func dlg) in _rcmdDelegates) { diff --git a/src/Ryujinx.HLE/Debugger/Gdb/Commands.cs b/src/Ryujinx.HLE/Debugger/Gdb/Commands.cs index 4a1fe3c93..a7cefce2e 100644 --- a/src/Ryujinx.HLE/Debugger/Gdb/Commands.cs +++ b/src/Ryujinx.HLE/Debugger/Gdb/Commands.cs @@ -422,9 +422,9 @@ namespace Ryujinx.HLE.Debugger.Gdb string command = Helpers.FromHex(hexCommand); Logger.Debug?.Print(LogClass.GdbStub, $"Received Rcmd: {command}"); - var rcmdDelegate = Debugger.FindRcmdDelegate(command); + Func rcmd = Debugger.FindRcmdDelegate(command); - Processor.ReplyHex(rcmdDelegate?.Invoke(Debugger) ?? $"Unknown command: {command}\n"); + Processor.ReplyHex(rcmd(Debugger)); } catch (Exception e) {