diff --git a/sdk/core/azure-core/inc/azure/core/exception.hpp b/sdk/core/azure-core/inc/azure/core/exception.hpp index bbf589985..193934c07 100644 --- a/sdk/core/azure-core/inc/azure/core/exception.hpp +++ b/sdk/core/azure-core/inc/azure/core/exception.hpp @@ -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(*other.RawResponse)) + RawResponse( + other.RawResponse + ? std::make_unique(*other.RawResponse) + : nullptr) { }