From 56d1ce52d4e0c28782040a74fa587a085021c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 2 Sep 2024 10:38:12 +0200 Subject: [PATCH] fix: Catch parsing errors or null doc structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/TemplateFieldService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/TemplateFieldService.php b/lib/Service/TemplateFieldService.php index d5ff291b2a..dfc21e4d7d 100644 --- a/lib/Service/TemplateFieldService.php +++ b/lib/Service/TemplateFieldService.php @@ -87,7 +87,7 @@ public function extractFields(Node|int $file): array { $form ); - $documentStructure = json_decode($response->getBody(), true)['DocStructure']; + $documentStructure = json_decode($response->getBody(), true)['DocStructure'] ?? []; $fields = []; foreach ($documentStructure as $index => $attr) {