From 54d443029880e0c0339f78f48a355aedf230ce37 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 28 Jun 2019 20:00:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix=20issue=20#5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the specified path does not exist, we want to return null to signal the caller to use the stable version instead --- VPUpdater/VirtualParadise.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VPUpdater/VirtualParadise.cs b/VPUpdater/VirtualParadise.cs index 8f64400..1ff5fa4 100644 --- a/VPUpdater/VirtualParadise.cs +++ b/VPUpdater/VirtualParadise.cs @@ -113,6 +113,11 @@ public static VirtualParadise GetCurrent() => /// Returns a new instance of , or on failure. public static VirtualParadise GetCurrent(string path) { + if (!File.Exists(path) && !Directory.Exists(path)) + { + return null; + } + FileAttributes attributes = File.GetAttributes(path); if (!attributes.HasFlag(FileAttributes.Directory)) {