From a37bd4e6592edaaad20bb3b225ab9fcd4e40f6f1 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Thu, 30 Nov 2023 12:07:49 -0500 Subject: [PATCH] Use ObjectDisposedException throw helper in ExternalPortForwarding --- .../EntryPoints/ExternalPortForwarding.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index c4cd935c37..7de184745a 100644 --- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -128,10 +128,7 @@ namespace Emby.Server.Implementations.EntryPoints private Task CreateRules(INatDevice device) { - if (_disposed) - { - throw new ObjectDisposedException(GetType().Name); - } + ObjectDisposedException.ThrowIf(_disposed, this); // On some systems the device discovered event seems to fire repeatedly // This check will help ensure we're not trying to port map the same device over and over