aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ContentDirectory/ControlHandler.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-10-06 20:21:23 +0200
committerBond_009 <bond.009@outlook.com>2022-10-06 20:21:23 +0200
commita9a5fcde81060c9da2096235d61128006339a2ee (patch)
tree3c3f7da26dffcc1a6589bcfc1cec2a5634e92c0e /Emby.Dlna/ContentDirectory/ControlHandler.cs
parent927fe33d3a0ec7f9e0fb568cfd423c6e8b966c9d (diff)
Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project) This reduces LOC and should improve performance (methods containing a throw statement don't get inlined) ``` if \((\w+) == null\) \s+\{ \s+throw new ArgumentNullException\((.*)\); \s+\} ``` ``` ArgumentNullException.ThrowIfNull($1); ```
Diffstat (limited to 'Emby.Dlna/ContentDirectory/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ContentDirectory/ControlHandler.cs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index 57170bb31..fc69960fd 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -114,15 +114,9 @@ namespace Emby.Dlna.ContentDirectory
/// <inheritdoc />
protected override void WriteResult(string methodName, IReadOnlyDictionary<string, string> methodParams, XmlWriter xmlWriter)
{
- if (xmlWriter == null)
- {
- throw new ArgumentNullException(nameof(xmlWriter));
- }
+ ArgumentNullException.ThrowIfNull(xmlWriter);
- if (methodParams == null)
- {
- throw new ArgumentNullException(nameof(methodParams));
- }
+ ArgumentNullException.ThrowIfNull(methodParams);
const string DeviceId = "test";