aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Channels
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-12-30 13:50:39 +0100
committerGitHub <noreply@github.com>2021-12-30 13:50:39 +0100
commitb2a2bdb088fc912e54655f6a277a43629ce277f4 (patch)
treeaf3106589e69a2813c6a7d5437bf52348fbf45fe /Emby.Server.Implementations/Channels
parentbb713d1931a591aa81372f6bdc60bac26e400a40 (diff)
parent7bfc6b5679308d3ec816e6f34b0dd54cf0cbd07c (diff)
Merge pull request #7049 from crobibero/warn40219
Diffstat (limited to 'Emby.Server.Implementations/Channels')
-rw-r--r--Emby.Server.Implementations/Channels/ChannelManager.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs
index 8702691d1..43c8a451b 100644
--- a/Emby.Server.Implementations/Channels/ChannelManager.cs
+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs
@@ -130,16 +130,14 @@ namespace Emby.Server.Implementations.Channels
var internalChannel = _libraryManager.GetItemById(item.ChannelId);
if (internalChannel == null)
{
- throw new ArgumentException();
+ throw new ArgumentException(nameof(item.ChannelId));
}
var channel = Channels.FirstOrDefault(i => GetInternalChannelId(i.Name).Equals(internalChannel.Id));
- var supportsDelete = channel as ISupportsDelete;
-
- if (supportsDelete == null)
+ if (channel is not ISupportsDelete supportsDelete)
{
- throw new ArgumentException();
+ throw new ArgumentException(nameof(channel));
}
return supportsDelete.DeleteItem(item.ExternalId, CancellationToken.None);