#vulnerable code 
                             @Override
	public BigDecimal convert(Currency from, Currency to, BigDecimal amount) {

		Map<Currency, BigDecimal> rates = getCurrentRates();
		BigDecimal baseRatio = rates.get(to).divide(rates.get(from), 4, RoundingMode.HALF_UP);

		return amount.multiply(baseRatio);
	} 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Override
	public BigDecimal convert(Currency from, Currency to, BigDecimal amount) {

		Assert.notNull(amount);

		Map<Currency, BigDecimal> rates = getCurrentRates();
		BigDecimal ratio = rates.get(to).divide(rates.get(from), 4, RoundingMode.HALF_UP);

		return amount.multiply(ratio);
	}