diff options
| author | Stepan Goremykin <goremukin@gmail.com> | 2023-10-08 01:25:37 +0200 |
|---|---|---|
| committer | Stepan Goremykin <goremukin@gmail.com> | 2023-10-08 01:25:37 +0200 |
| commit | fdef9356b9ba483e437fbc3a2bc0b6aaf3c05c29 (patch) | |
| tree | 221c5b7b39581783557ede161187e72db68d78eb /Emby.Dlna | |
| parent | 212976277d43a1d9a4186c6536e4a8cb3eefd639 (diff) | |
Use null propagation
Diffstat (limited to 'Emby.Dlna')
| -rw-r--r-- | Emby.Dlna/PlayTo/Device.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index d21cc69132..8dc2184415 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -927,14 +927,11 @@ namespace Emby.Dlna.PlayTo var resElement = container.Element(UPnpNamespaces.Res); - if (resElement is not null) - { - var info = resElement.Attribute(UPnpNamespaces.ProtocolInfo); + var info = resElement?.Attribute(UPnpNamespaces.ProtocolInfo); - if (info is not null && !string.IsNullOrWhiteSpace(info.Value)) - { - return info.Value.Split(':'); - } + if (info is not null && !string.IsNullOrWhiteSpace(info.Value)) + { + return info.Value.Split(':'); } return new string[4]; |
