From 10083e6b2ad61499889b8e80462f081973b8c9ef Mon Sep 17 00:00:00 2001 From: Krzysztof Nozderko Date: Mon, 19 Feb 2024 16:58:56 +0100 Subject: [PATCH] handle the case of no executable --- Snowflake.Data/Core/Tools/EnvironmentOperations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Snowflake.Data/Core/Tools/EnvironmentOperations.cs b/Snowflake.Data/Core/Tools/EnvironmentOperations.cs index eb77eb56f..fd5676183 100644 --- a/Snowflake.Data/Core/Tools/EnvironmentOperations.cs +++ b/Snowflake.Data/Core/Tools/EnvironmentOperations.cs @@ -24,7 +24,7 @@ public virtual string GetFolderPath(Environment.SpecialFolder folder) public virtual string GetExecutionDirectory() { var executablePath = Environment.GetCommandLineArgs()[0]; - return Path.GetDirectoryName(executablePath); + return string.IsNullOrEmpty(executablePath) ? null : Path.GetDirectoryName(executablePath); } } }