From 3b09527de0a27cc6af166cbe252cd887de51845e Mon Sep 17 00:00:00 2001 From: Pulkit Kathuria Date: Sun, 8 Sep 2024 13:35:32 +0900 Subject: [PATCH] Fixes #390, bug introduced by https://github.com/rakutentech/laravel-request-docs/pull/383/files#diff-f600e2d16aa771125109175741a976a1830757a43642073d5ef74dafc31a4191R30 --- ui/src/components/elements/ApiActionResponse.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/components/elements/ApiActionResponse.tsx b/ui/src/components/elements/ApiActionResponse.tsx index 01b6a80..ec6fe04 100644 --- a/ui/src/components/elements/ApiActionResponse.tsx +++ b/ui/src/components/elements/ApiActionResponse.tsx @@ -27,7 +27,8 @@ export default function ApiActionResponse(props: Props) { const [previousResponse, setPreviousResponse] = useLocalStorage('previousResponse' + requestUri + method, ''); const [isHtml, setIsHtml] = useState(false); useEffect(() => { - if (JSON.parse(responseHeaders)['content-type'].split(';')[0] === 'text/html') { + + if (responseHeaders && JSON.parse(responseHeaders)['content-type'].split(';')[0] === 'text/html') { setIsHtml(true) }