From dcfefa21abdd3e867d5a9d46695a39550ff93553 Mon Sep 17 00:00:00 2001 From: HONGFEI YANG Date: Tue, 22 Feb 2022 18:51:09 +1100 Subject: [PATCH] fix: fixed casting null to Tuple2 when link dialog is dismissed without any input (e.g. barrier dismissed) (#681) --- lib/src/widgets/toolbar/link_style_button.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/toolbar/link_style_button.dart b/lib/src/widgets/toolbar/link_style_button.dart index e479481c..9ca83fb6 100644 --- a/lib/src/widgets/toolbar/link_style_button.dart +++ b/lib/src/widgets/toolbar/link_style_button.dart @@ -120,7 +120,11 @@ class _LinkStyleButtonState extends State { return _LinkDialog( dialogTheme: widget.dialogTheme, link: link, text: text); }, - ).then(_linkSubmitted); + ).then( + (value) { + if (value != null) _linkSubmitted(value); + }, + ); } String? _getLinkAttributeValue() {