Skip to content

Commit

Permalink
fix(ui-concerto): fallback to regular input field if cannot parse rel…
Browse files Browse the repository at this point in the history
…ationship

Signed-off-by: Diana Lease <[email protected]>
  • Loading branch information
DianaLease committed Aug 20, 2020
1 parent d61e17f commit e34ccfa
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/ui-concerto/src/lib/components/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,21 @@ export const ConcertoRelationship = ({
return null;
}

const relationship = Relationship.fromURI(field.getModelFile().getModelManager(), value);
let relationship;
try {
relationship = Relationship.fromURI(field.getModelFile().getModelManager(), value);
} catch {
return ConcertoInput({
id,
field,
readOnly,
required,
value,
onFieldValueChange,
skipLabel,
type,
});
}

return <Form.Field required={required}>
<ConcertoLabel skip={skipLabel} name={field.getName()} />
Expand Down

0 comments on commit e34ccfa

Please sign in to comment.