Skip to content

Commit

Permalink
Merge pull request #3956 from nextcloud/fix/catch-uncovered-field-types
Browse files Browse the repository at this point in the history
fix: Catch InvalidFieldTypeException
  • Loading branch information
juliushaertl committed Aug 28, 2024
2 parents c6fbca0 + 67c63ba commit 714f8ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Service/TemplateFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OCP\Files\Template\Field;
use OCP\Files\Template\FieldFactory;
use OCP\Files\Template\FieldType;
use OCP\Files\Template\InvalidFieldTypeException;
use OCP\Http\Client\IClientService;
use OCP\ICacheFactory;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -95,7 +96,11 @@ public function extractFields(Node|int $file): array {
continue;
}

$field = FieldFactory::createField($index, $fieldType);
try {
$field = FieldFactory::createField($index, $fieldType);
} catch (InvalidFieldTypeException) {
continue;
}
$field->id = $attr['id'];
$field->tag = $attr['tag'];
$field->alias = $attr['alias'];
Expand Down

0 comments on commit 714f8ba

Please sign in to comment.