aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-15 13:12:43 -0700
committercrobibero <cody@robibe.ro>2020-11-15 13:12:43 -0700
commit4b15284324cf65bc916a3112b7fc61c958ac70c5 (patch)
treee125c2e1f04526509cc6f0c72e7e922c4276e02e /Jellyfin.Api/Helpers/ProgressiveFileCopier.cs
parent7ff212576e1fba5980163bcc1cd97c29aadc635f (diff)
parent2f426dfc97677deffb60420078b20a7f5f03977e (diff)
Merge remote-tracking branch 'upstream/master' into bye-tvdb
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;