Skip to content

Commit

Permalink
avniproject/avni-webapp#1133 | add size check to prevent invalid acce…
Browse files Browse the repository at this point in the history
…ss to questionGroupObservation
  • Loading branch information
himeshr committed May 3, 2024
1 parent 458dcf9 commit 1758d1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ObservationsHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ObservationsHolder {
const observations = this.findObservation(parentFormElement.concept);
const groupObservations = observations && observations.getValueWrapper();
if (parentFormElement.repeatable) {
return groupObservations && groupObservations.getGroupObservationAtIndex(questionGroupIndex).getObservation(concept);
return groupObservations && groupObservations.size() > questionGroupIndex && groupObservations.getGroupObservationAtIndex(questionGroupIndex).getObservation(concept);
}
return groupObservations && groupObservations.getObservation(concept);
}
Expand Down

0 comments on commit 1758d1f

Please sign in to comment.