Skip to content

Commit d3d61fa

Browse files
committed
avniproject/Goonj#131 | ref: Activity | adding education and health field null check
1 parent be857f4 commit d3d61fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

goonj/src/main/java/org/avni_integration_service/goonj/repository/ActivityRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ private ActivityDTO createActivityRequest(Subject subject) {
157157
/* Photograph fields */
158158
activityDTO.setNjpcPhotograph(getPhotographStrings(PHOTOGRAPH, subject));
159159
/*Education fields*/
160-
if(subject.getObservation(EDUCATION_AND_HEALTH).equals(YES)){
160+
String educationAndHealth = (String) subject.getObservation(EDUCATION_AND_HEALTH);
161+
if(educationAndHealth!=null && educationAndHealth.equals(YES)){
161162
activityDTO.setEducationAndHealth(true);
162163
activityDTO.setMaleStudent((int)subject.getObservation(MALE_STUDENT));
163164
activityDTO.setFemaleStudent((int)subject.getObservation(FEMALE_STUDENT));

0 commit comments

Comments
 (0)