Skip to content

Commit

Permalink
Quick safe fix for 810 (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford authored Jun 23, 2020
1 parent de1a3d6 commit c9e0d25
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/AzureRMTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,17 @@ export class AzureRMTools {

if (codeLens instanceof ResolvableCodeLens) {
const cancel = new Cancellation(token);
const { associatedDoc } = await this.getDeploymentDocAndAssociatedDoc(codeLens.deploymentDoc.documentUri, cancel);
if (codeLens.resolve(associatedDoc)) {
assert(codeLens.command?.command && codeLens.command.title, "CodeLens wasn't resolved");
try {
const { associatedDoc } = await this.getDeploymentDocAndAssociatedDoc(codeLens.deploymentDoc.documentUri, cancel);
if (codeLens.resolve(associatedDoc)) {
assert(codeLens.command?.command && codeLens.command.title, "CodeLens wasn't resolved");
return codeLens;
}
} catch (err) {
codeLens.command = {
title: 'Unable to open parameter file',
command: ''
};
return codeLens;
}
} else {
Expand Down

0 comments on commit c9e0d25

Please sign in to comment.