Check if runtimeConfigPath exists before reading the file in IsPortableApp.

If it doesn't exist, then it isn't a portable app.
This commit is contained in:
Eric Erhardt 2016-04-08 12:52:57 -05:00
parent 5684f9933d
commit 9f61ad51aa

View file

@ -170,7 +170,7 @@ namespace Microsoft.DotNet.Cli.Utils
? Directory.EnumerateFiles(commandDir).FirstOrDefault(x => x.EndsWith("runtimeconfig.json"))
: runtimeConfigPath;
if (runtimeConfigPath == null)
if (runtimeConfigPath == null || !File.Exists(runtimeConfigPath))
{
return false;
}