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 <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 28, 2024
1 parent 1838651 commit 72f3fee
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);

Check failure on line 100 in lib/Service/TemplateFieldService.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedClass

lib/Service/TemplateFieldService.php:100:15: UndefinedClass: Class, interface or enum named OCP\Files\Template\FieldFactory does not exist (see https://psalm.dev/019)
} catch (InvalidFieldTypeException) {
continue;
}
$field->id = $attr['id'];
$field->tag = $attr['tag'];
$field->alias = $attr['alias'];
Expand Down

0 comments on commit 72f3fee

Please sign in to comment.