From ff5001fe411e1ee47a474fa716bb4cd8683fcf1a Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Tue, 13 May 2008 15:41:25 -0700 Subject: [PATCH] Changed calls to longValue to calls to doubleValue; using the former is potentially a problem when something's saved as an NSString when we expect an NSNumber. This'll handle both cases. --- SUUpdater.m | 4 ++-- SUUserInitiatedUpdateDriver.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SUUpdater.m b/SUUpdater.m index 165e6097..9e5beb1c 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -82,9 +82,9 @@ static SUUpdater *sharedUpdater = nil; { // Find the stored check interval. User defaults override Info.plist. if ([[SUUserDefaults standardUserDefaults] objectForKey:SUScheduledCheckIntervalKey]) - checkInterval = [[[SUUserDefaults standardUserDefaults] objectForKey:SUScheduledCheckIntervalKey] longValue]; + checkInterval = [[[SUUserDefaults standardUserDefaults] objectForKey:SUScheduledCheckIntervalKey] doubleValue]; else if ([hostBundle objectForInfoDictionaryKey:SUScheduledCheckIntervalKey]) - checkInterval = [[hostBundle objectForInfoDictionaryKey:SUScheduledCheckIntervalKey] longValue]; + checkInterval = [[hostBundle objectForInfoDictionaryKey:SUScheduledCheckIntervalKey] doubleValue]; if (checkInterval < SU_MIN_CHECK_INTERVAL) // This can also mean one that isn't set. checkInterval = SU_DEFAULT_CHECK_INTERVAL; diff --git a/SUUserInitiatedUpdateDriver.m b/SUUserInitiatedUpdateDriver.m index 0e79b3a3..fbbff90e 100644 --- a/SUUserInitiatedUpdateDriver.m +++ b/SUUserInitiatedUpdateDriver.m @@ -108,7 +108,7 @@ { // We do this here instead of in extractUpdate so that we only have a determinate progress bar for archives with progress. if ([statusController maxProgressValue] == 0) - [statusController setMaxProgressValue:[[[[NSFileManager defaultManager] fileAttributesAtPath:downloadPath traverseLink:NO] objectForKey:NSFileSize] longValue]]; + [statusController setMaxProgressValue:[[[[NSFileManager defaultManager] fileAttributesAtPath:downloadPath traverseLink:NO] objectForKey:NSFileSize] doubleValue]]; [statusController setProgressValue:[statusController progressValue] + length]; }