Skip to content

Commit

Permalink
add explicit type existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Dec 7, 2020
1 parent a58269d commit 5fb4119
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ export class AssignmentService {
types,
maxResults = 100,
}: FindAssignableObjectsOptions): Promise<AssignableObject[]> {
const searchedTypes = types
const searchedTypes = (types
? types.filter((type) => taggableTypes.includes(type))
: taggableTypes;
: taggableTypes
).filter((type) => this.typeRegistry.getType(type) !== undefined);
const assignableTypes = await this.getAssignableTypes(searchedTypes);

// if no provided type was assignable, return an empty list instead of throwing an error
Expand Down

0 comments on commit 5fb4119

Please sign in to comment.