BigDecimal在java中是一种特殊的类了,关于BigDecimal中空指针异常的处理做了如下的控制就可以了
if (!monthlyPaymentsSum.equals(BigDecimal.ZERO))
{
debtEchoInfo.setCreditMonthlyWithoutCard(monthlyPaymentsSum.add(debtEchoInfo.getCardMonthly()));
}else {
debtEchoInfo.setCreditMonthlyWithoutCard(debtEchoInfo.getCardMonthly());
}