From a3f64697d856d0fdb3140f6c815107bc60a7e878 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Wed, 27 Mar 2024 12:30:49 -0500 Subject: [PATCH] Fixed tests --- src/Foundatio.Storage.SshNet/Storage/SshNetFileStorage.cs | 3 +++ .../Storage/SshNetStorageTests.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Foundatio.Storage.SshNet/Storage/SshNetFileStorage.cs b/src/Foundatio.Storage.SshNet/Storage/SshNetFileStorage.cs index 7dede8e..ca3117d 100644 --- a/src/Foundatio.Storage.SshNet/Storage/SshNetFileStorage.cs +++ b/src/Foundatio.Storage.SshNet/Storage/SshNetFileStorage.cs @@ -84,6 +84,9 @@ public Task GetFileInfoAsync(string path) try { var file = _client.Get(normalizedPath); + if (file.IsDirectory) + return Task.FromResult(null); + return Task.FromResult(new FileSpec { Path = normalizedPath, diff --git a/tests/Foundatio.Storage.SshNet.Tests/Storage/SshNetStorageTests.cs b/tests/Foundatio.Storage.SshNet.Tests/Storage/SshNetStorageTests.cs index 8962495..19be7f8 100644 --- a/tests/Foundatio.Storage.SshNet.Tests/Storage/SshNetStorageTests.cs +++ b/tests/Foundatio.Storage.SshNet.Tests/Storage/SshNetStorageTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Foundatio.Storage; using Foundatio.Tests.Storage;