mirror of
https://github.com/atom/atom.git
synced 2026-02-18 02:21:43 -05:00
Guard against a null initial path
This will be the case when the .atom fold is opened from the config window. path.join() cannot be called with null values.
This commit is contained in:
@@ -28,11 +28,14 @@ class AtomWindow
|
||||
@browserWindow.loadSettings.initialPath
|
||||
|
||||
containsPath: (pathToCheck) ->
|
||||
if not pathToCheck
|
||||
initialPath = @getInitialPath()
|
||||
if not initialPath
|
||||
false
|
||||
else if pathToCheck is @getInitialPath()
|
||||
else if not pathToCheck
|
||||
false
|
||||
else if pathToCheck is initialPath
|
||||
true
|
||||
else if pathToCheck.indexOf(path.join(@getInitialPath(), path.sep)) is 0
|
||||
else if pathToCheck.indexOf(path.join(initialPath, path.sep)) is 0
|
||||
true
|
||||
else
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user