summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-04-05 19:46:42 +0200
committerDamiano Galassi <[email protected]>2019-04-05 19:46:42 +0200
commitd7ac67abc802ff09c106057cb3eb327d0d0716a6 (patch)
tree5d4bdafd71ee7742694d6e210baab18ff0486093 /macosx
parent6f5d33cf7cd54642e01158d40546bea9fe60941d (diff)
MacGui: fail gracefully when trying to encode to a not available disk under the sandbox.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBCore.m17
-rw-r--r--macosx/HBJob.m3
2 files changed, 12 insertions, 8 deletions
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index 40117d4f5..8a5c91230 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -505,15 +505,18 @@ typedef void (^HBCoreCleanupHandler)(void);
- (void)startProgressReporting:(NSURL *)fileURL
{
- NSDictionary *userInfo = @{NSProgressFileURLKey : fileURL};
+ if (fileURL)
+ {
+ NSDictionary *userInfo = @{NSProgressFileURLKey : fileURL};
- self.progress = [[NSProgress alloc] initWithParent:nil userInfo:userInfo];
- self.progress.totalUnitCount = 100;
- self.progress.kind = NSProgressKindFile;
- self.progress.pausable = NO;
- self.progress.cancellable = NO;
+ self.progress = [[NSProgress alloc] initWithParent:nil userInfo:userInfo];
+ self.progress.totalUnitCount = 100;
+ self.progress.kind = NSProgressKindFile;
+ self.progress.pausable = NO;
+ self.progress.cancellable = NO;
- [self.progress publish];
+ [self.progress publish];
+ }
}
- (void)stopProgressReporting
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index ce92ed4bc..ce7f9f586 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -447,7 +447,8 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
{
_outputURL = [HBUtilities URLFromBookmark:_outputURLFolderBookmark];
}
- else
+
+ if (!_outputURL)
{
decodeObject(_outputURL, NSURL);
}