From 76906f90f7a2041504a54ffcb8e4f2cd774a59aa Mon Sep 17 00:00:00 2001 From: filipw Date: Thu, 18 May 2017 22:23:33 +0300 Subject: [PATCH] check if folder path exists before attempting to load assemblies --- src/OmniSharp.Host/Services/AssemblyLoader.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OmniSharp.Host/Services/AssemblyLoader.cs b/src/OmniSharp.Host/Services/AssemblyLoader.cs index 3f3ecf5d48..ff927a083f 100644 --- a/src/OmniSharp.Host/Services/AssemblyLoader.cs +++ b/src/OmniSharp.Host/Services/AssemblyLoader.cs @@ -38,6 +38,12 @@ public IReadOnlyList LoadAllFrom(string folderPath) { if (string.IsNullOrWhiteSpace(folderPath)) return Array.Empty(); + if (!Directory.Exists(folderPath)) + { + _logger.LogWarning($"Attempted to load assemblies from '{folderPath}' but that path doesn't exist."); + return Array.Empty(); + } + var assemblies = new List(); foreach (var filePath in Directory.EnumerateFiles(folderPath, "*.dll")) {