Skip to content

Commit

Permalink
Fixes #2200 making the delete primitive not die.
Browse files Browse the repository at this point in the history
Previously - the harddisk volume delete primitive would die
with null ref when the path doesn't exist.  The problem
only happened on the local volume (archive didn't have the
same bug).

Now - it returns false like the archive version does.
  • Loading branch information
Dunbaratu committed Dec 23, 2017
1 parent 9c30a07 commit b46e03d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/kOS.Safe/Persistence/Harddisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public override bool Delete(VolumePath path, bool ksmDefault = false)

HarddiskDirectory directory = ParentDirectoryForPath(path);

if (directory == null)
{
return false;
}

return directory.Delete(path.Name, ksmDefault);
}

Expand Down

0 comments on commit b46e03d

Please sign in to comment.