Skip to content

Commit 420f92e

Browse files
committed
avoid html editor not initialized exception
1 parent 430272d commit 420f92e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/screens/create_or_edit_work_item/controller_create_or_edit_work_item.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,8 @@ class _CreateOrEditWorkItemController with FilterMixin, AppLogger, AdsMixin {
597597
fieldData.controller.text = text.formatted;
598598

599599
if (fieldData.editorController != null) {
600-
_trySetText(fieldData, text);
600+
// wait a bit because the editor might not be initialized yet
601+
Timer(Duration(milliseconds: 500), () => _trySetText(fieldData, text));
601602
}
602603
}
603604
}
@@ -621,7 +622,7 @@ class _CreateOrEditWorkItemController with FilterMixin, AppLogger, AdsMixin {
621622
void _trySetText(DynamicFieldData fieldData, String text) {
622623
try {
623624
fieldData.editorController!.setText(text);
624-
} catch (e) {
625+
} catch (_) {
625626
// ignore
626627
}
627628
}

0 commit comments

Comments
 (0)