From 53a7ef6203056fbd6af3572e191375c59fa80b02 Mon Sep 17 00:00:00 2001 From: Michael West Date: Thu, 19 Sep 2024 07:46:19 -0500 Subject: [PATCH] #1358 : Return null when the drive object is null. --- src/Spe/Core/Provider/PsSitecoreItemProvider.PathHandling.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Spe/Core/Provider/PsSitecoreItemProvider.PathHandling.cs b/src/Spe/Core/Provider/PsSitecoreItemProvider.PathHandling.cs index b464c62b..cf91f1c4 100644 --- a/src/Spe/Core/Provider/PsSitecoreItemProvider.PathHandling.cs +++ b/src/Spe/Core/Provider/PsSitecoreItemProvider.PathHandling.cs @@ -16,6 +16,8 @@ public partial class PsSitecoreItemProvider private Item GetItemForPath(string path) { + if (PSDriveInfo == null) return null; + var colonIndex = path.IndexOf(':'); var relativePath = path.Substring(colonIndex + 1).Replace('\\', '/'); var databaseName = colonIndex < 0 ? PSDriveInfo.Name : path.Substring(0, colonIndex);