From 44a9ac6c3fa9a8a1164de19e5b30f9e223ba8437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Pi=C4=85tek?= Date: Wed, 9 Aug 2023 23:17:59 +0200 Subject: [PATCH] Fix file picker --- src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs b/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs index 9d8edec..c93def6 100644 --- a/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs +++ b/src/ScriptRunner/ScriptRunner.GUI/ParamsPanelFactory.cs @@ -228,7 +228,7 @@ private IControlRecord CreateControlRecord(ScriptParam p, string? value, int ind } }; case PromptType.FileContent: - if (Path.IsPathRooted(value) == false) + if (string.IsNullOrWhiteSpace(value) == false && Path.IsPathRooted(value) == false) { value = Path.GetFullPath(value, scriptConfig.WorkingDirectory); } @@ -247,7 +247,7 @@ private IControlRecord CreateControlRecord(ScriptParam p, string? value, int ind }; case PromptType.FilePicker: - if (Path.IsPathRooted(value) == false) + if (string.IsNullOrWhiteSpace(value)== false && Path.IsPathRooted(value) == false) { value = Path.GetFullPath(value, scriptConfig.WorkingDirectory); } @@ -263,7 +263,7 @@ private IControlRecord CreateControlRecord(ScriptParam p, string? value, int ind } }; case PromptType.DirectoryPicker: - if (Path.IsPathRooted(value) == false) + if (string.IsNullOrWhiteSpace(value)== false && Path.IsPathRooted(value) == false) { value = Path.GetFullPath(value, scriptConfig.WorkingDirectory); }