Skip to content

Commit

Permalink
Hosted plugin: catch error when no scanner for the selected project
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroNahari committed Apr 21, 2020
1 parent 7d56c34 commit 4076cc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/plugin-dev/src/node/hosted-instance-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ export abstract class AbstractHostedInstanceManager implements HostedInstanceMan
const pckPath = path.join(FileUri.fsPath(uri), 'package.json');
if (fs.existsSync(pckPath)) {
const pck = require(pckPath);
return !!this.metadata.getScanner(pck);
try {
return !!this.metadata.getScanner(pck);
} catch (e) {
console.error(e);
return false;
}
}
return false;
}
Expand Down

0 comments on commit 4076cc7

Please sign in to comment.