Skip to content

Commit

Permalink
fix: Catch parsing errors or null doc structure
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Sep 2, 2024
1 parent d8b4aeb commit 56d1ce5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/TemplateFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 56d1ce5

Please sign in to comment.