diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs index d02ccf9..b75827c 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs @@ -297,7 +297,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels // Make sure the Node process is finished // TODO: Is there a more graceful way to end it? Or does this still let it perform any cleanup? - if (!_nodeProcess.HasExited) + if (_nodeProcess != null && !_nodeProcess.HasExited) { _nodeProcess.Kill(); }