From 01530d637d790a101ea4dcb0e183664420d98ff9 Mon Sep 17 00:00:00 2001 From: Michael VanOverbeek Date: Tue, 7 Mar 2017 13:14:07 +0000 Subject: Fix NPC generation --- ShiftOS.Objects/ShiftFS.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ShiftOS.Objects') diff --git a/ShiftOS.Objects/ShiftFS.cs b/ShiftOS.Objects/ShiftFS.cs index e14c2a8..2c6b28b 100644 --- a/ShiftOS.Objects/ShiftFS.cs +++ b/ShiftOS.Objects/ShiftFS.cs @@ -291,10 +291,13 @@ namespace ShiftOS.Objects.ShiftFS { string[] pathlist = path.Split('/'); int vol = Convert.ToInt32(pathlist[0].Replace(":", "")); + if (Mounts[vol] == null) + Mounts[vol] = new Directory(); var dir = Mounts[vol]; + for (int i = 1; i <= pathlist.Length - 1; i++) { - dir = dir.FindDirectoryByName(pathlist[i]); + dir = dir?.FindDirectoryByName(pathlist[i]); } return dir != null; -- cgit v1.2.3