aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2020-11-19 09:04:49 +0000
committerGitHub <noreply@github.com>2020-11-19 09:04:49 +0000
commitef05485243b1d0043b442a4f5ab4cc9be99f16bb (patch)
tree39fbf843ae9ebb0c15902d18c3617aece339df50 /Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
parent3ffdcfdb802079ee9ad3e76527b4519f3fe4458a (diff)
parent49ebbcf87edb805862c032e48796d2b8020e5aa7 (diff)
Merge branch 'master' into PluginConfigSave
Diffstat (limited to 'Jellyfin.Api/Helpers/ProgressiveFileCopier.cs')
-rw-r--r--Jellyfin.Api/Helpers/ProgressiveFileCopier.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs b/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
index e00ed3304..8bddf00d5 100644
--- a/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
+++ b/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
@@ -5,6 +5,7 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Models.PlaybackDtos;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
@@ -90,6 +91,11 @@ namespace Jellyfin.Api.Helpers
allowAsyncFileRead = true;
}
+ if (_path == null)
+ {
+ throw new ResourceNotFoundException(nameof(_path));
+ }
+
await using var inputStream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, IODefaults.FileStreamBufferSize, fileOptions);
var eofCount = 0;