From db30c6cf56d1b452797e2adc39bd793eb3af2505 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Fri, 21 Sep 2018 10:40:33 -0400 Subject: [PATCH] Fix NullReferenceException in ValidateProviderChannelTypes() --- src/Tgstation.Server.Api/Models/ChatBot.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Api/Models/ChatBot.cs b/src/Tgstation.Server.Api/Models/ChatBot.cs index 716469fd6e..578e84446e 100644 --- a/src/Tgstation.Server.Api/Models/ChatBot.cs +++ b/src/Tgstation.Server.Api/Models/ChatBot.cs @@ -21,9 +21,9 @@ namespace Tgstation.Server.Api.Models switch (Provider) { case ChatProvider.Discord: - return Channels.Select(x => x.DiscordChannelId.HasValue && x.IrcChannel == null).All(x => x); + return Channels?.Select(x => x.DiscordChannelId.HasValue && x.IrcChannel == null).All(x => x) ?? true; case ChatProvider.Irc: - return Channels.Select(x => !x.DiscordChannelId.HasValue && x.IrcChannel != null).All(x => x); + return Channels?.Select(x => !x.DiscordChannelId.HasValue && x.IrcChannel != null).All(x => x) ?? true; default: throw new InvalidOperationException("Invalid provider type!"); }