Seems simple and obvious because it is, we should check that startBlock exists before using it
This commit is contained in:
Tom Moor
2018-01-30 08:24:49 -08:00
parent 7be5b5fa0d
commit 66c091cfbb

View File

@@ -138,7 +138,8 @@ class LinkToolbar extends Component {
if (href) {
change.setInline({ type: 'link', data: { href } });
} else if (link) {
const selContainsLink = !!change.value.startBlock.getChild(link.key);
const startBlock = change.value.startBlock;
const selContainsLink = !!(startBlock && startBlock.getChild(link.key));
if (selContainsLink) change.unwrapInlineByKey(link.key);
}
change.deselect();