Skip to content

Commit 50783c0

Browse files
committed
Merge branch 'main' into integration_tests
2 parents f0528b5 + 9c68aee commit 50783c0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: lib/pages/forms_pages/components/biting_form.dart

+7-5
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,13 @@ class _BitingFormState extends State<BitingForm> {
572572
var bodyParts = Utils.report!.responses!
573573
.where((element) => element!.question_id == 2)
574574
.toList();
575-
if (int.parse(bodyParts.last!.answer_value!) > 1) {
576-
bodyParts.last!.answer_value =
577-
(int.parse(bodyParts.last!.answer_value!) - 1).toString();
578-
} else {
579-
bodyParts.removeLast();
575+
if (bodyParts.isNotEmpty) {
576+
if (int.parse(bodyParts.last!.answer_value!) > 1) {
577+
bodyParts.last!.answer_value =
578+
(int.parse(bodyParts.last!.answer_value!) - 1).toString();
579+
} else {
580+
bodyParts.removeLast();
581+
}
580582
}
581583

582584
Utils.report!.responses = <dynamic>{

0 commit comments

Comments
 (0)