Fix a potential NullReferenceException in GetLaunchResult

This commit is contained in:
Jordan Brown
2020-07-11 12:14:17 -04:00
parent e473446315
commit 13441348b7
@@ -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;