From c9e0d25c03950936d806d4d628422f955093d18a Mon Sep 17 00:00:00 2001 From: "Stephen Weatherford (MSFT)" Date: Mon, 22 Jun 2020 18:58:01 -0700 Subject: [PATCH] Quick safe fix for 810 (#812) --- src/AzureRMTools.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/AzureRMTools.ts b/src/AzureRMTools.ts index 899c979a1..ea6255d5f 100644 --- a/src/AzureRMTools.ts +++ b/src/AzureRMTools.ts @@ -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 {