diff --git a/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java b/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java index 421d3efc..3d083715 100644 --- a/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java +++ b/goonj/src/main/java/org/avni_integration_service/goonj/repository/DistributionRepository.java @@ -91,8 +91,8 @@ private DistributionDTO createDistributionRequest(Subject subject) { Date distributionDate = DateTimeUtil.convertToDate((String) subject.getObservation(DISTRIBUTION_DATE)); distributionDate = DateTimeUtil.offsetTimeZone(distributionDate, DateTimeUtil.UTC, DateTimeUtil.IST); distributionDTO.setDateOfDistribution(DateTimeUtil.formatDate(distributionDate)); - List typeOfCommunity = (ArrayList) subject.getObservation(TYPE_OF_COMMUNITY); - if(typeOfCommunity!= null){ + if(subject.getObservation(TYPE_OF_COMMUNITY)!= null){ + List typeOfCommunity = (ArrayList) subject.getObservation(TYPE_OF_COMMUNITY); distributionDTO.setTypeOfCommunity(String.join(";",typeOfCommunity)); }else{ distributionDTO.setTypeOfCommunity((String) subject.getObservation(TARGET_COMMUNITY));