Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Ensure opening file without project does not crash, fixes #133
Browse files Browse the repository at this point in the history
  • Loading branch information
damieng committed Oct 9, 2018
1 parent dce4f0c commit 19cf48e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class TypeScriptLanguageClient extends AutoLanguageClient {
}

getProjectPath(filePath) {
return atom.project.getDirectories().find(d => filePath.startsWith(d.path)).path
const projectPath = atom.project.getDirectories().find(d => filePath.startsWith(d.path))
return projectPath != null ? projectPath.path : ''
}

createTimeoutPromise(milliseconds) {
Expand Down

0 comments on commit 19cf48e

Please sign in to comment.