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 ...@@ -46,18 +46,19 @@ export const DataLinksValueEditor: React.FC<FieldConfigEditorProps<DataLink[], D
return ( return (
<> <>
{value.map((l, i) => { {value &&
return ( value.map((l, i) => {
<DataLinksListItem return (
key={`${l.title}/${i}`} <DataLinksListItem
index={i} key={`${l.title}/${i}`}
link={l} index={i}
onChange={onDataLinkChange} link={l}
data={context.data} onChange={onDataLinkChange}
suggestions={context.getSuggestions ? context.getSuggestions() : []} data={context.data}
/> suggestions={context.getSuggestions ? context.getSuggestions() : []}
); />
})} );
})}
<Forms.Button size="sm" icon="fa fa-plus" onClick={onDataLinkAdd}> <Forms.Button size="sm" icon="fa fa-plus" onClick={onDataLinkAdd}>
Create data link 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