From 662c77a28323dc1477ddcbdffd12683a6fef13cc Mon Sep 17 00:00:00 2001 From: Falanwe Date: Fri, 4 Sep 2020 15:32:29 +0200 Subject: [PATCH] [cpp-ue4] add support for empty response (#7333) --- .../src/main/resources/cpp-ue4/api-source.mustache | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache index c1ca56649e5..58d2bc7656a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache @@ -56,7 +56,11 @@ void {{classname}}::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceede FString ContentType = HttpResponse->GetContentType(); FString Content; - if (ContentType == TEXT("application/json")) + if(ContentType.IsEmpty()) + { + return; // Nothing to parse + } + else if (ContentType == TEXT("application/json")) { Content = HttpResponse->GetContentAsString();