mirror of
https://github.com/overte-org/overte.git
synced 2025-05-31 07:40:31 +02:00
Merge pull request #15840 from danteruiz/launcher-issues
BUGZ-837: Fix Launcher crash (mac)
This commit is contained in:
commit
d13b8d354c
2 changed files with 18 additions and 11 deletions
|
@ -6,12 +6,18 @@
|
|||
@implementation LatestBuildRequest
|
||||
|
||||
- (NSInteger) getCurrentVersion {
|
||||
NSString* interfaceAppPath = [[Launcher.sharedLauncher getAppPath] stringByAppendingString:@"interface.app"];
|
||||
NSError * error = nil;
|
||||
Interface * interface = [[Interface alloc] initWith:interfaceAppPath];
|
||||
NSInteger currentVersion = [interface getVersion:&error];
|
||||
if (currentVersion == 0 && error != nil) {
|
||||
NSLog(@"can't get version from interface, falling back to settings: %@", error);
|
||||
NSInteger currentVersion;
|
||||
@try {
|
||||
NSString* interfaceAppPath = [[Launcher.sharedLauncher getAppPath] stringByAppendingString:@"interface.app"];
|
||||
NSError * error = nil;
|
||||
Interface * interface = [[Interface alloc] initWith:interfaceAppPath];
|
||||
currentVersion = [interface getVersion:&error];
|
||||
if (currentVersion == 0 && error != nil) {
|
||||
NSLog(@"can't get version from interface, falling back to settings: %@", error);
|
||||
currentVersion = [Settings.sharedSettings latestBuildVersion];
|
||||
}
|
||||
} @catch (NSException *exception) {
|
||||
NSLog(@"an exception was thrown: %@", exception);
|
||||
currentVersion = [Settings.sharedSettings latestBuildVersion];
|
||||
}
|
||||
return currentVersion;
|
||||
|
@ -58,6 +64,7 @@
|
|||
BOOL appDirectoryExist = [fileManager fileExistsAtPath:[[sharedLauncher getAppPath] stringByAppendingString:@"interface.app"]];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
NSInteger currentVersion = [self getCurrentVersion];
|
||||
NSLog(@"Latest Build Request -> does build directory exist: %@", appDirectoryExist ? @"TRUE" : @"FALSE");
|
||||
NSLog(@"Latest Build Request -> current version: %ld", currentVersion);
|
||||
|
|
Loading…
Reference in a new issue