From 3c829d9e8ad97d5ab2a19c5f77bb56327ded2336 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 8 Jun 2016 14:20:05 -0700 Subject: [PATCH] Fix Interactive window .npm commands sometimes failing in VS 2015 update 3 If `dteProject.FullName` is empty when we execute an `.npm` command in the interactive window, an exception is thrown by `Path.GetDirectoryName(dteProject.FullName)` and we end up not doing anything. Check if `dteProject.FullName` is empty or null before calling `GetDirectoryName` --- Nodejs/Product/Nodejs/Repl/NpmReplCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nodejs/Product/Nodejs/Repl/NpmReplCommand.cs b/Nodejs/Product/Nodejs/Repl/NpmReplCommand.cs index 6cc8e3fa1..3a938e273 100644 --- a/Nodejs/Product/Nodejs/Repl/NpmReplCommand.cs +++ b/Nodejs/Product/Nodejs/Repl/NpmReplCommand.cs @@ -108,7 +108,7 @@ public async Task Execute(IReplWindow window, string arguments) } // Otherwise, fall back to using fullname - string projectDirectory = Path.GetDirectoryName(dteProject.FullName); + string projectDirectory = string.IsNullOrEmpty(dteProject.FullName) ? null : Path.GetDirectoryName(dteProject.FullName); if (!string.IsNullOrEmpty(projectDirectory)) { projectNameToDirectoryDictionary.Add(projectName, Tuple.Create(projectDirectory, hierarchy)); }