From d8aeee485070dd5c3886aeea9b7c2356df72fe62 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 25 Jan 2021 09:33:46 +0100 Subject: [PATCH] Plugins: Fix attempting to validate non-required but empty path --- Il2CppInspector.Common/Plugins/API/V100/IPluginOption.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Plugins/API/V100/IPluginOption.cs b/Il2CppInspector.Common/Plugins/API/V100/IPluginOption.cs index a6e3d0f..c9f307b 100644 --- a/Il2CppInspector.Common/Plugins/API/V100/IPluginOption.cs +++ b/Il2CppInspector.Common/Plugins/API/V100/IPluginOption.cs @@ -166,8 +166,12 @@ namespace Il2CppInspector.PluginAPI.V100 if (Required && string.IsNullOrWhiteSpace(path)) throw new ArgumentException("Path name is required"); + // Only validate a non-required path name if it is non-empty + if (!Required && string.IsNullOrEmpty(path)) + return; + // Throws an exception if the path is invalid (file or folder may or may not exist) - var fullPath = Path.GetFullPath(path ?? ""); + var fullPath = Path.GetFullPath(path); var fileName = Path.GetFileName(fullPath); if (IsFolder) {