浏览代码

Use ObjectDisposedException throw helper in ExternalPortForwarding

Patrick Barron 1 年之前
父节点
当前提交
a37bd4e659
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs

+ 1 - 4
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