mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix server NRE in console command completions.
Happens if you just type "tp:to<space>" into the console. Toolshed can fail to provide completion results, in which case a null propagates and possibly crashes the server.
This commit is contained in:
@@ -44,6 +44,7 @@ END TEMPLATE-->
|
||||
### Bugfixes
|
||||
|
||||
* Fix `IClipboardManager.GetText()` returning null in some cases.
|
||||
* Fix possible NRE in server-side console command completion code.
|
||||
|
||||
### Other
|
||||
|
||||
|
||||
@@ -259,6 +259,9 @@ namespace Robust.Server.Console
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
result ??= CompletionResult.Empty;
|
||||
|
||||
var msg = new MsgConCompletionResp
|
||||
{
|
||||
Result = result,
|
||||
|
||||
@@ -4,14 +4,12 @@ using Robust.Shared.Serialization;
|
||||
|
||||
namespace Robust.Shared.Network.Messages;
|
||||
|
||||
#nullable disable
|
||||
|
||||
public sealed class MsgConCompletionResp : NetMessage
|
||||
{
|
||||
public override MsgGroups MsgGroup => MsgGroups.Command;
|
||||
|
||||
public int Seq { get; set; }
|
||||
public CompletionResult Result { get; set; }
|
||||
public CompletionResult Result { get; set; } = default!;
|
||||
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user