Return early on errors

This commit is contained in:
Kevin Sawicki
2014-11-18 13:15:16 -08:00
parent 64612d4734
commit 1575ee9037

View File

@@ -66,6 +66,8 @@ uninstallContextMenu = (callback) ->
updatePath = (callback) ->
getPath = (callback) ->
spawnReg ['query', environmentKeyPath, '/v', 'Path'], (error, stdout) ->
return callback(error) if error?
lines = stdout.split(/[\r\n]+/).filter (line) -> line
segments = lines[lines.length - 1]?.split(' ')
if segments[1] is 'Path' and segments.length >= 3