Skip to content

Commit

Permalink
#121 | null check before type casting in distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
vedfordev committed May 1, 2024
1 parent 7acad07 commit a3b4620
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> typeOfCommunity = (ArrayList<String>) subject.getObservation(TYPE_OF_COMMUNITY);
if(typeOfCommunity!= null){
if(subject.getObservation(TYPE_OF_COMMUNITY)!= null){
List<String> typeOfCommunity = (ArrayList<String>) subject.getObservation(TYPE_OF_COMMUNITY);
distributionDTO.setTypeOfCommunity(String.join(";",typeOfCommunity));
}else{
distributionDTO.setTypeOfCommunity((String) subject.getObservation(TARGET_COMMUNITY));
Expand Down

0 comments on commit a3b4620

Please sign in to comment.