We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f0528b5 + 9c68aee commit 50783c0Copy full SHA for 50783c0
lib/pages/forms_pages/components/biting_form.dart
@@ -572,11 +572,13 @@ class _BitingFormState extends State<BitingForm> {
572
var bodyParts = Utils.report!.responses!
573
.where((element) => element!.question_id == 2)
574
.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();
+ if (bodyParts.isNotEmpty) {
+ if (int.parse(bodyParts.last!.answer_value!) > 1) {
+ bodyParts.last!.answer_value =
+ (int.parse(bodyParts.last!.answer_value!) - 1).toString();
+ } else {
580
+ bodyParts.removeLast();
581
+ }
582
}
583
584
Utils.report!.responses = <dynamic>{
0 commit comments