diff options
author | Damiano Galassi <[email protected]> | 2017-04-21 13:48:25 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-04-21 13:50:48 +0200 |
commit | 2cda3db7473c5751a9e785269ad43a76bbc34de6 (patch) | |
tree | cb6d21aca3679a7d66a39100f4c6eaa8d87eb449 /macosx/HBJob.m | |
parent | bc092457f1409c7d014bbdd3fbd65db0340244bf (diff) |
MacGui: do not load a job from disk if one or more job objects are missing.
Diffstat (limited to 'macosx/HBJob.m')
-rw-r--r-- | macosx/HBJob.m | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/macosx/HBJob.m b/macosx/HBJob.m index 15f77ede2..5d01987b6 100644 --- a/macosx/HBJob.m +++ b/macosx/HBJob.m @@ -377,10 +377,10 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; if (version == 3 && (self = [super init])) { decodeInt(_state); - decodeObject(_name, NSString); - decodeObject(_presetName, NSString); + decodeObjectOrFail(_name, NSString); + decodeObjectOrFail(_presetName, NSString); decodeInt(_titleIdx); - decodeObject(_uuid, NSString); + decodeObjectOrFail(_uuid, NSString); #ifdef __SANDBOX_ENABLED__ _fileURLBookmark = [HBCodingUtilities decodeObjectOfClass:[NSData class] forKey:@"_fileURLBookmark" decoder:decoder]; @@ -417,15 +417,15 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; decodeBool(_mp4HttpOptimize); decodeBool(_mp4iPodCompatible); - decodeObject(_range, HBRange); - decodeObject(_video, HBVideo); - decodeObject(_picture, HBPicture); - decodeObject(_filters, HBFilters); + decodeObjectOrFail(_range, HBRange); + decodeObjectOrFail(_video, HBVideo); + decodeObjectOrFail(_picture, HBPicture); + decodeObjectOrFail(_filters, HBFilters); _video.job = self; - decodeObject(_audio, HBAudio); - decodeObject(_subtitles, HBSubtitles); + decodeObjectOrFail(_audio, HBAudio); + decodeObjectOrFail(_subtitles, HBSubtitles); _audio.job = self; _video.job = self; @@ -436,6 +436,7 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; return self; } +fail: return nil; } |