From e7c87f6a77281223215b7f91279f05b8e0b3e24a Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 17 Jul 2023 04:16:39 -0400 Subject: [PATCH] Skip index if directory doesn't exist --- StabilityMatrix.Core/Services/SettingsManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/StabilityMatrix.Core/Services/SettingsManager.cs b/StabilityMatrix.Core/Services/SettingsManager.cs index 5598adbb..5567e24f 100644 --- a/StabilityMatrix.Core/Services/SettingsManager.cs +++ b/StabilityMatrix.Core/Services/SettingsManager.cs @@ -429,6 +429,9 @@ public class SettingsManager : ISettingsManager var modelHashes = new HashSet(); var sharedModelDirectory = Path.Combine(LibraryDir, "Models"); + + if (!Directory.Exists(sharedModelDirectory)) return; + var connectedModelJsons = Directory.GetFiles(sharedModelDirectory, "*.cm-info.json", SearchOption.AllDirectories); foreach (var jsonFile in connectedModelJsons)