From b14f7d9963d717ea2df35d3fbb62ea27573dc29b Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Tue, 16 Nov 2021 13:34:28 -0500 Subject: [PATCH] Fix errors on 20X responses with no body `''` is not json-parsable, so in that case we return null. This was the behavior prior to f5cab714e1b78d5690601738e5fbce2a33733645 --- framework/core/js/src/common/Application.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/core/js/src/common/Application.tsx b/framework/core/js/src/common/Application.tsx index f840fdea8..461b25952 100644 --- a/framework/core/js/src/common/Application.tsx +++ b/framework/core/js/src/common/Application.tsx @@ -438,6 +438,10 @@ export default class Application { } try { + if (responseText === '') { + return null; + } + return JSON.parse(responseText); } catch (e) { throw new RequestError(500, `${responseText}`, options, xhr);