We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b0b345 commit e6a8b37Copy full SHA for e6a8b37
src/nativeStub.m
@@ -471,7 +471,14 @@ - (NSString *)description {
471
NSString *result = execute(path, @[@"-version"]);
472
// The actual version will be between the first two quotes in the result
473
// We can reasonably ignore all the rest of the output
474
- return [result componentsSeparatedByString:@"\""][1];
+ NSArray *components = [result componentsSeparatedByString:@"\""];
475
+ if (components.count > 1) {
476
+ return components[1];
477
+ } else {
478
+ // Handle unexpected format
479
+ NSLog(@"Error: Unexpected version string format: %@", result);
480
+ return nil;
481
+ }
482
}
483
484
NSString *normalizeJavaVersion(NSString *version) {
0 commit comments