diff --git a/lib/atom-ternjs-server.js b/lib/atom-ternjs-server.js index 17a6285..e761492 100644 --- a/lib/atom-ternjs-server.js +++ b/lib/atom-ternjs-server.js @@ -322,9 +322,13 @@ export default class Server { } let found = - this.findFile(file, projectDir, path.resolve(this.distDir, 'defs')) || - resolveFrom(projectDir, `tern-${src[i]}`) - ; + this.findFile(file, projectDir, path.resolve(this.distDir, 'defs')); + + if (!found) { + try { + found = resolveFrom(projectDir, `tern-${src[i]}`); + } catch (e) {} + } if (!found) { @@ -367,9 +371,14 @@ export default class Server { } let found = - this.findFile(`${plugin}.js`, projectDir, path.resolve(this.distDir, 'plugin')) || - resolveFrom(projectDir, `tern-${plugin}`) - ; + this.findFile(`${plugin}.js`, projectDir, path.resolve(this.distDir, 'plugin')); + + if (!found) { + try { + resolveFrom(projectDir, `tern-${plugin}`) + } + catch (e) {} + } if (!found) {