aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sync/SyncJobProcessor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-28 14:56:37 -0500
committerGitHub <noreply@github.com>2016-12-28 14:56:37 -0500
commit4ab4442b88cfbd6ddba1bfcea3aa39cb9589861a (patch)
treed05a86773a01b25836b60a9e053dd32729d5f245 /Emby.Server.Implementations/Sync/SyncJobProcessor.cs
parentbda4afeede5fee042705fdf53a42ac30d8522107 (diff)
parent5e4bf3c36f31bc60a547937b107d0bb61968b9d6 (diff)
Merge pull request #2370 from MediaBrowser/dev
add sync error handling
Diffstat (limited to 'Emby.Server.Implementations/Sync/SyncJobProcessor.cs')
-rw-r--r--Emby.Server.Implementations/Sync/SyncJobProcessor.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Sync/SyncJobProcessor.cs b/Emby.Server.Implementations/Sync/SyncJobProcessor.cs
index 415757609..b1adc64df 100644
--- a/Emby.Server.Implementations/Sync/SyncJobProcessor.cs
+++ b/Emby.Server.Implementations/Sync/SyncJobProcessor.cs
@@ -515,8 +515,14 @@ namespace Emby.Server.Implementations.Sync
jobItem.Progress = 0;
- var syncOptions = _config.GetSyncOptions();
var job = _syncManager.GetJob(jobItem.JobId);
+ if (job == null)
+ {
+ _logger.Error("Job not found. Cannot complete the sync job.");
+ await _syncManager.CancelJobItem(jobItem.Id).ConfigureAwait(false);
+ return;
+ }
+
var user = _userManager.GetUserById(job.UserId);
if (user == null)
{
@@ -552,6 +558,8 @@ namespace Emby.Server.Implementations.Sync
}
}
+ var syncOptions = _config.GetSyncOptions();
+
var video = item as Video;
if (video != null)
{