From 3f56fac50cb91f24b2b0c40d951709416416f159 Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Fri, 28 May 2021 01:33:36 +0800 Subject: [PATCH] fix a crash issue when copying a RequestFailedException with null RawResponse #2358 --- sdk/core/azure-core/inc/azure/core/exception.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { }