if(dbRecord.getPropertyDocumentTypeDetailID().getTypeDetailID().equalsTo(applicationPropertyDetailBean.getPropertyDocumentTypeDetailID()) !=0){
isRequiredRoiCall=true;
}
This piece of code returns Null exception when one of the values is null.
CodePudding user response:
You can add if statement with null checking.
Smth like this:
if(dbRecord.getPropertyDocumentTypeDetailID() != null && ...)
Or use Optional.ofNullable
CodePudding user response:
You shoud make sure:
dbRecord != null
dbRecord.getPropertyDocumentTypeDetailID() != null
dbRecord.getPropertyDocumentTypeDetailID().getTypeDetailID() != null
applicationPropertyDetailBean != null