diff --git a/Minio/MinioClient.cs b/Minio/MinioClient.cs index 1b9711092..71fd1139c 100644 --- a/Minio/MinioClient.cs +++ b/Minio/MinioClient.cs @@ -145,7 +145,7 @@ private static void ParseErrorNoContent(ResponseResult response) #pragma warning disable MA0099 // Use Explicit enum value instead of 0 if (response.StatusCode == 0) throw new ConnectionException("Connection error:" + response.ErrorMessage, response); - if (response.Exception.GetType() == typeof(TaskCanceledException)) + if (response.Exception?.GetType() == typeof(TaskCanceledException)) throw response.Exception; #pragma warning restore MA0099 // Use Explicit enum value instead of 0 throw new InternalClientException(