mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Use null coalescing when possible
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user