From 13441348b7cbe3e7248db334f51f69bc4fcbdf27 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 11 Jul 2020 12:14:17 -0400 Subject: [PATCH] Fix a potential NullReferenceException in GetLaunchResult --- .../Components/Session/SessionController.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionController.cs b/src/Tgstation.Server.Host/Components/Session/SessionController.cs index 7ee1624b2a..a5c1560ff9 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionController.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionController.cs @@ -339,12 +339,15 @@ namespace Tgstation.Server.Host.Components.Session reattachTopicCts.Token) .ConfigureAwait(false); - if (reattachResponse.InteropResponse?.CustomCommands != null) - chatTrackingContext.CustomCommands = reattachResponse.InteropResponse.CustomCommands; - else if (reattachResponse.InteropResponse != null) - logger.LogWarning( - "DMAPI v{0} isn't returning the TGS custom commands list. Functionality added in v5.2.0.", - Dmb.CompileJob.DMApiVersion.Semver()); + if (reattachResponse != null) + { + if (reattachResponse.InteropResponse?.CustomCommands != null) + chatTrackingContext.CustomCommands = reattachResponse.InteropResponse.CustomCommands; + else if (reattachResponse.InteropResponse != null) + logger.LogWarning( + "DMAPI v{0} isn't returning the TGS custom commands list. Functionality added in v5.2.0.", + Dmb.CompileJob.DMApiVersion.Semver()); + } } return result;