Skip to content

Commit

Permalink
check if folder path exists before attempting to load assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw committed May 18, 2017
1 parent 247715b commit 76906f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/OmniSharp.Host/Services/AssemblyLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public IReadOnlyList<Assembly> LoadAllFrom(string folderPath)
{
if (string.IsNullOrWhiteSpace(folderPath)) return Array.Empty<Assembly>();

if (!Directory.Exists(folderPath))
{
_logger.LogWarning($"Attempted to load assemblies from '{folderPath}' but that path doesn't exist.");
return Array.Empty<Assembly>();
}

var assemblies = new List<Assembly>();
foreach (var filePath in Directory.EnumerateFiles(folderPath, "*.dll"))
{
Expand Down

0 comments on commit 76906f9

Please # to comment.