Fix: Clicking on the Link icon without any text on a new line will crash

pull/650/head
X Code 3 years ago
parent 90ecc8aec2
commit a82692fe58
  1. 5
      lib/src/widgets/toolbar/link_style_button.dart

@ -114,8 +114,9 @@ class _LinkStyleButtonState extends State<LinkStyleButton> {
}
}
text ??= widget.controller.document
.getPlainText(index, widget.controller.selection.end - index);
final len = widget.controller.selection.end - index;
text ??=
len == 0 ? '' : widget.controller.document.getPlainText(index, len);
return _LinkDialog(
dialogTheme: widget.dialogTheme, link: link, text: text);
},

Loading…
Cancel
Save