Skip to content

Commit

Permalink
Merge pull request #3968 from nextcloud/backport/3967/stable30
Browse files Browse the repository at this point in the history
[stable30] fix: Catch parsing errors or null doc structure
  • Loading branch information
juliushaertl committed Sep 2, 2024
2 parents 577d396 + daea8d6 commit f079a6f
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 @@ -86,7 +86,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 f079a6f

Please sign in to comment.