diff --git a/products/ASC.Files/Server/Core/Thirdparty/Box/BoxProviderInfo.cs b/products/ASC.Files/Server/Core/Thirdparty/Box/BoxProviderInfo.cs index bfb6912075..ef23278eb2 100644 --- a/products/ASC.Files/Server/Core/Thirdparty/Box/BoxProviderInfo.cs +++ b/products/ASC.Files/Server/Core/Thirdparty/Box/BoxProviderInfo.cs @@ -203,7 +203,10 @@ namespace ASC.Files.Thirdparty.Box public void Dispose() { - Storage.Close(); + if (Storage != null) + { + Storage.Close(); + } } } diff --git a/products/ASC.Files/Server/Core/Thirdparty/OneDrive/OneDriveProviderInfo.cs b/products/ASC.Files/Server/Core/Thirdparty/OneDrive/OneDriveProviderInfo.cs index dea82eb69c..9e704bd508 100644 --- a/products/ASC.Files/Server/Core/Thirdparty/OneDrive/OneDriveProviderInfo.cs +++ b/products/ASC.Files/Server/Core/Thirdparty/OneDrive/OneDriveProviderInfo.cs @@ -179,7 +179,10 @@ namespace ASC.Files.Thirdparty.OneDrive public void Dispose() { - Storage.Close(); + if (Storage != null && Storage.IsOpened) + { + Storage.Close(); + } } } diff --git a/products/ASC.Files/Server/Core/Thirdparty/Sharpbox/SharpBoxProviderInfo.cs b/products/ASC.Files/Server/Core/Thirdparty/Sharpbox/SharpBoxProviderInfo.cs index c98d8b7d5f..de89024cde 100644 --- a/products/ASC.Files/Server/Core/Thirdparty/Sharpbox/SharpBoxProviderInfo.cs +++ b/products/ASC.Files/Server/Core/Thirdparty/Sharpbox/SharpBoxProviderInfo.cs @@ -169,8 +169,10 @@ namespace ASC.Files.Thirdparty.Sharpbox public void Dispose() { - if (Storage.IsOpened) + if (Storage != null && Storage.IsOpened) + { Storage.Close(); + } } }