Koenig - Fixed error on Cmd+K with no selection

refs https://github.com/TryGhost/Ghost/issues/9505
This commit is contained in:
Kevin Ansfield 2018-05-22 14:01:03 +01:00
parent 20d8c924a2
commit bc3356051d

View File

@ -1,6 +1,6 @@
export function getLinkMarkupFromRange(range) {
let {headMarker, tailMarker} = range;
if (headMarker === tailMarker || headMarker.next === tailMarker) {
if (headMarker && (headMarker === tailMarker || headMarker.next === tailMarker)) {
return tailMarker.markups.findBy('tagName', 'a');
}
}