Skip to content

Commit 473e056

Browse files
committed
Throw an exception on a never null method when result set is empty
1 parent 8816b27 commit 473e056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/javax/money/spi/MonetaryCurrenciesSingletonSpi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ default Set<CurrencyUnit> getCurrencies(String... providers) {
169169
default CurrencyUnit getCurrency(CurrencyQuery query) {
170170
Set<CurrencyUnit> currencies = getCurrencies(query);
171171
if (currencies.isEmpty()) {
172-
return null;
172+
throw new MonetaryException("CurrencyUnit not found: " + query);
173173
}
174174
if (currencies.size() == 1) {
175175
return currencies.iterator().next();

0 commit comments

Comments
 (0)