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:
Kevin Sawicki
2013-06-12 14:30:56 -07:00
parent 750e4a1cca
commit 0f4ad0bbf5

View File

@@ -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