Skip to content

Commit

Permalink
avoid html editor not initialized exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sstasi95 committed Feb 11, 2025
1 parent 430272d commit 420f92e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ class _CreateOrEditWorkItemController with FilterMixin, AppLogger, AdsMixin {
fieldData.controller.text = text.formatted;

if (fieldData.editorController != null) {
_trySetText(fieldData, text);
// wait a bit because the editor might not be initialized yet
Timer(Duration(milliseconds: 500), () => _trySetText(fieldData, text));
}
}
}
Expand All @@ -621,7 +622,7 @@ class _CreateOrEditWorkItemController with FilterMixin, AppLogger, AdsMixin {
void _trySetText(DynamicFieldData fieldData, String text) {
try {
fieldData.editorController!.setText(text);
} catch (e) {
} catch (_) {
// ignore
}
}
Expand Down

0 comments on commit 420f92e

Please sign in to comment.