Don't try to active windows without a path

Previously Atom would crash if a path was opened when there
was already a window open that did not have a path, such as
the specs window.

Now window controllers without a path are skipped during the
checks to activate an existing window for an opened path.
This commit is contained in:
Kevin Sawicki
2013-04-17 18:43:58 -07:00
parent 599328cb9c
commit f93b09fc9e

View File

@@ -150,6 +150,9 @@
for (NSWindow *window in [self windows]) {
if (![window isExcludedFromWindowsMenu]) {
AtomWindowController *controller = [window windowController];
if (!controller.pathToOpen) {
continue;
}
if (!openingDirectory) {
BOOL openedPathIsDirectory = false;
[[NSFileManager defaultManager] fileExistsAtPath:controller.pathToOpen isDirectory:&openedPathIsDirectory];