mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 20:59:17 +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,14 +6,20 @@
|
||||||
@implementation LatestBuildRequest
|
@implementation LatestBuildRequest
|
||||||
|
|
||||||
- (NSInteger) getCurrentVersion {
|
- (NSInteger) getCurrentVersion {
|
||||||
|
NSInteger currentVersion;
|
||||||
|
@try {
|
||||||
NSString* interfaceAppPath = [[Launcher.sharedLauncher getAppPath] stringByAppendingString:@"interface.app"];
|
NSString* interfaceAppPath = [[Launcher.sharedLauncher getAppPath] stringByAppendingString:@"interface.app"];
|
||||||
NSError * error = nil;
|
NSError * error = nil;
|
||||||
Interface * interface = [[Interface alloc] initWith:interfaceAppPath];
|
Interface * interface = [[Interface alloc] initWith:interfaceAppPath];
|
||||||
NSInteger currentVersion = [interface getVersion:&error];
|
currentVersion = [interface getVersion:&error];
|
||||||
if (currentVersion == 0 && error != nil) {
|
if (currentVersion == 0 && error != nil) {
|
||||||
NSLog(@"can't get version from interface, falling back to settings: %@", error);
|
NSLog(@"can't get version from interface, falling back to settings: %@", error);
|
||||||
currentVersion = [Settings.sharedSettings latestBuildVersion];
|
currentVersion = [Settings.sharedSettings latestBuildVersion];
|
||||||
}
|
}
|
||||||
|
} @catch (NSException *exception) {
|
||||||
|
NSLog(@"an exception was thrown: %@", exception);
|
||||||
|
currentVersion = [Settings.sharedSettings latestBuildVersion];
|
||||||
|
}
|
||||||
return currentVersion;
|
return currentVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +64,7 @@
|
||||||
BOOL appDirectoryExist = [fileManager fileExistsAtPath:[[sharedLauncher getAppPath] stringByAppendingString:@"interface.app"]];
|
BOOL appDirectoryExist = [fileManager fileExistsAtPath:[[sharedLauncher getAppPath] stringByAppendingString:@"interface.app"]];
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
|
||||||
NSInteger currentVersion = [self getCurrentVersion];
|
NSInteger currentVersion = [self getCurrentVersion];
|
||||||
NSLog(@"Latest Build Request -> does build directory exist: %@", appDirectoryExist ? @"TRUE" : @"FALSE");
|
NSLog(@"Latest Build Request -> does build directory exist: %@", appDirectoryExist ? @"TRUE" : @"FALSE");
|
||||||
NSLog(@"Latest Build Request -> current version: %ld", currentVersion);
|
NSLog(@"Latest Build Request -> current version: %ld", currentVersion);
|
||||||
|
|
Loading…
Reference in a new issue