Skip to content

Commit

Permalink
MacGui: avoid passing a nil value to NSKeyedArchiver
Browse files Browse the repository at this point in the history
  • Loading branch information
galad87 committed Jul 17, 2024
1 parent b8d4592 commit e296ff4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions macosx/HBPreferencesController.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ + (void)setHardwareDecoderSupported:(BOOL)hardwareDecoderSupported
+ (void)registerUserDefaults
{
NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults;

NSData *moviesData = nil;
NSURL *moviesURL = HBUtilities.defaultDestinationFolderURL;
if (moviesData)
{
moviesData = [NSKeyedArchiver archivedDataWithRootObject:moviesURL requiringSecureCoding:YES error:NULL];
}

if (@available(macOS 13, *))
{
Expand All @@ -195,8 +201,6 @@ + (void)registerUserDefaults
HBPreferencesController.hardwareDecoderSupported = NO;
}

NSData *moviesData = [NSKeyedArchiver archivedDataWithRootObject:moviesURL requiringSecureCoding:YES error:NULL];

[defaults registerDefaults:@{
HBShowOpenPanelAtLaunch: @YES,
HBShowSummaryPreview: @YES,
Expand Down

0 comments on commit e296ff4

Please sign in to comment.