Skip to content

Commit 2f24f43

Browse files
author
Paul van Brenk
committed
Fix null reference when redirector is null.
1 parent 55a40aa commit 2f24f43

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Nodejs/Product/Nodejs/Workspace/ContextMenuProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ private async void ExecDynamic(WorkspaceVisualNodeBase node, uint nCmdID)
152152
var filePath = ((IFileNode)node).FullPath;
153153
if (TryGetCommand(nCmdID, filePath, out var commandName))
154154
{
155-
156155
using (var npmController = this.CreateController(node.Workspace))
157156
using (var commander = npmController.CreateNpmCommander())
158157
{

Nodejs/Product/Npm/SPI/NpmCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ await NpmHelpers.ExecuteNpmCommandAsync(
106106
cancelled = true;
107107
}
108108
OnCommandCompleted(this.Arguments, redirector?.HasErrors ?? false, cancelled);
109-
return !redirector.HasErrors;
109+
return redirector == null || !redirector.HasErrors; // return true when the command completed without errors, or redirector is null (which means we can't track)
110110
}
111111

112112
private sealed class NpmCommandRedirector : Redirector

0 commit comments

Comments
 (0)