Skip to content

Commit

Permalink
🐞 Fix issue #5
Browse files Browse the repository at this point in the history
If the specified path does not exist, we want to return null to
signal the caller to use the stable version instead
  • Loading branch information
oliverbooth committed Jun 28, 2019
1 parent 3339356 commit 54d4430
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions VPUpdater/VirtualParadise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ public static VirtualParadise GetCurrent() =>
/// <returns>Returns a new instance of <see cref="VirtualParadise"/>, or <see langword="null"/> on failure.</returns>
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))
{
Expand Down

0 comments on commit 54d4430

Please sign in to comment.