Merge pull request #992 from Musoni/MIFOSX-1399

fix adding new guaraton to loan account having existing guarantor
This commit is contained in:
Vishwas Babu A J
2014-07-02 14:38:38 -07:00
@@ -81,7 +81,7 @@ public class GuarantorWritePlatformServiceJpaRepositoryIImpl implements Guaranto
final Long entityId = guarantorCommand.getEntityId();
for (final Guarantor guarantor : existGuarantorList) {
if (guarantor.getLoanId() == loanId && guarantor.getEntityId() == entityId) {
if (guarantor.getLoanId() == loanId && entityId !=null && guarantor.getEntityId() == entityId) {
String defaultUserMessage = this.clientRepositoryWrapper.findOneWithNotFoundDetection(entityId).getDisplayName();
defaultUserMessage = defaultUserMessage + " is already exist as a guarantor for this loan";
final String action = loan.client() != null ? "client.guarantor" : "group.guarantor";