mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
fix SA1503 for one line if statements
This commit is contained in:
@@ -259,9 +259,20 @@ namespace Rssdp
|
||||
/// <seealso cref="DeviceAdded"/>
|
||||
public void AddDevice(SsdpEmbeddedDevice device)
|
||||
{
|
||||
if (device == null) throw new ArgumentNullException(nameof(device));
|
||||
if (device.RootDevice != null && device.RootDevice != this.ToRootDevice()) throw new InvalidOperationException("This device is already associated with a different root device (has been added as a child in another branch).");
|
||||
if (device == this) throw new InvalidOperationException("Can't add device to itself.");
|
||||
if (device == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(device));
|
||||
}
|
||||
|
||||
if (device.RootDevice != null && device.RootDevice != this.ToRootDevice())
|
||||
{
|
||||
throw new InvalidOperationException("This device is already associated with a different root device (has been added as a child in another branch).");
|
||||
}
|
||||
|
||||
if (device == this)
|
||||
{
|
||||
throw new InvalidOperationException("Can't add device to itself.");
|
||||
}
|
||||
|
||||
bool wasAdded = false;
|
||||
lock (_Devices)
|
||||
@@ -287,7 +298,10 @@ namespace Rssdp
|
||||
/// <seealso cref="DeviceRemoved"/>
|
||||
public void RemoveDevice(SsdpEmbeddedDevice device)
|
||||
{
|
||||
if (device == null) throw new ArgumentNullException(nameof(device));
|
||||
if (device == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(device));
|
||||
}
|
||||
|
||||
bool wasRemoved = false;
|
||||
lock (_Devices)
|
||||
|
||||
Reference in New Issue
Block a user