Skip to content

Commit

Permalink
Fix RangeError in markdownNewLine Function for Text Insertion (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dante291 committed Mar 9, 2024
1 parent c6ca138 commit 1970340
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/pages/home/report_bug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ class _ReportFormState extends ConsumerState<ReportForm> {
int end = _descriptionController.selection.extentOffset;
String text = _descriptionController.text;

if (start < 0) start = 0;
if (end < 0) end = text.length;

if (end < start) {
int temp = start;
start = end;
Expand Down

0 comments on commit 1970340

Please sign in to comment.