mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Don't crash when running dev with no resource path
Previously if the --dev flag was used and no resource was specified or found in ~/github/atom then the app would crash trying to add a null resource path to the node paths list. Now the bundle resource path is the fallback whenever the dev resource path cannot be found or does not exist.
This commit is contained in:
@@ -34,10 +34,7 @@
|
||||
|
||||
AtomApplication *atomApplication = (AtomApplication *)[AtomApplication sharedApplication];
|
||||
|
||||
if (useBundleResourcePath) {
|
||||
_resourcePath = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
}
|
||||
else {
|
||||
if (!useBundleResourcePath) {
|
||||
_resourcePath = [[atomApplication.arguments objectForKey:@"resource-path"] stringByStandardizingPath];
|
||||
if (!_resourcePath) {
|
||||
NSString *defaultRepositoryPath = [@"~/github/atom" stringByStandardizingPath];
|
||||
@@ -48,11 +45,15 @@
|
||||
_resourcePath = defaultRepositoryPath;
|
||||
}
|
||||
else {
|
||||
_resourcePath = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
NSLog(@"Warning: No resource path specified and no directory exists at ~/github/atom");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!_resourcePath) {
|
||||
_resourcePath = [[NSBundle bundleForClass:self.class] resourcePath];
|
||||
}
|
||||
|
||||
if ([self isDevMode]) {
|
||||
[self displayDevIcon];
|
||||
|
||||
Reference in New Issue
Block a user