mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 08:00:19 +01:00
Fix NullReferenceException in ValidateProviderChannelTypes()
This commit is contained in:
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user