Commit 173375cb by Ryan McKinley Committed by GitHub

DataLinks: Avoid null exception in new edit mode (#22100)

parent 2a2b33bb
......@@ -46,18 +46,19 @@ export const DataLinksValueEditor: React.FC<FieldConfigEditorProps<DataLink[], D
return (
<>
{value.map((l, i) => {
return (
<DataLinksListItem
key={`${l.title}/${i}`}
index={i}
link={l}
onChange={onDataLinkChange}
data={context.data}
suggestions={context.getSuggestions ? context.getSuggestions() : []}
/>
);
})}
{value &&
value.map((l, i) => {
return (
<DataLinksListItem
key={`${l.title}/${i}`}
index={i}
link={l}
onChange={onDataLinkChange}
data={context.data}
suggestions={context.getSuggestions ? context.getSuggestions() : []}
/>
);
})}
<Forms.Button size="sm" icon="fa fa-plus" onClick={onDataLinkAdd}>
Create data link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment