fix a crash issue when copying a RequestFailedException with null RawResponse #2358

This commit is contained in:
JinmingHu 2021-05-28 01:33:36 +08:00 committed by GitHub
parent 3596685e80
commit 3f56fac50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,10 @@ namespace Azure { namespace Core {
: std::runtime_error(other.Message), StatusCode(other.StatusCode),
ReasonPhrase(other.ReasonPhrase), ClientRequestId(other.ClientRequestId),
RequestId(other.RequestId), ErrorCode(other.ErrorCode), Message(other.Message),
RawResponse(std::make_unique<Azure::Core::Http::RawResponse>(*other.RawResponse))
RawResponse(
other.RawResponse
? std::make_unique<Azure::Core::Http::RawResponse>(*other.RawResponse)
: nullptr)
{
}