Skip to content

Commit

Permalink
fix: Catch InvalidFieldTypeException
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Aug 29, 2024
1 parent 2872792 commit f37c709
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 f37c709

Please sign in to comment.