diff options
| author | crobibero <cody@robibe.ro> | 2020-11-13 11:24:46 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-13 11:24:46 -0700 |
| commit | 95ebb9a55ace6c544fa7fa15d0a255a5cee752a8 (patch) | |
| tree | f5ce2c6ea994d63712d45772ad712ac6bcf79ab6 /Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | |
| parent | 5f52a58e785fa4ae06fa07a93b81c1e7547ac9f3 (diff) | |
Use null coalescing when possible
Diffstat (limited to 'Emby.Server.Implementations/AppBase/ConfigurationHelper.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/ConfigurationHelper.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index 8cca5cc77..b0a14f43d 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -50,11 +50,7 @@ namespace Emby.Server.Implementations.AppBase // If the file didn't exist before, or if something has changed, re-save if (buffer == null || !newBytes.AsSpan(0, newBytesLen).SequenceEqual(buffer)) { - var directory = Path.GetDirectoryName(path); - if (directory == null) - { - throw new ResourceNotFoundException(nameof(directory)); - } + var directory = Path.GetDirectoryName(path) ?? throw new ResourceNotFoundException(nameof(path)); Directory.CreateDirectory(directory); // Save it after load in case we got new items |
