From 0b320ad33e94203b6dc43c52433384ff8069f8ef Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 15 Sep 2017 10:29:14 +0300 Subject: [PATCH] Client: ServerServiceHelper: Improved error handling of ListShares method --- SMBLibrary/Client/Helpers/ServerServiceHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMBLibrary/Client/Helpers/ServerServiceHelper.cs b/SMBLibrary/Client/Helpers/ServerServiceHelper.cs index e23d044..ace5fbf 100644 --- a/SMBLibrary/Client/Helpers/ServerServiceHelper.cs +++ b/SMBLibrary/Client/Helpers/ServerServiceHelper.cs @@ -97,7 +97,7 @@ namespace SMBLibrary.Client } NetrShareEnumResponse shareEnumResponse = new NetrShareEnumResponse(responseData); ShareInfo1Container shareInfo1 = shareEnumResponse.InfoStruct.Info as ShareInfo1Container; - if (shareInfo1 == null) + if (shareInfo1 == null || shareInfo1.Entries == null) { if (shareEnumResponse.Result == Win32Error.ERROR_ACCESS_DENIED) {