catalog: Fix NPE for when there is no price
It is not clear if plugin will return an empty list or a null list of prices when there is nothing (e.g fixed price),
so this code change hardens for both situations.
package org.killbill.billing.catalog.plugin;
-import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -452,7 +451,7 @@ public class StandaloneCatalogMapper {
private DefaultInternationalPrice toDefaultInternationalPrice(final InternationalPrice input) {
DefaultInternationalPrice result = null;
- if (input != null) {
+ if (input != null && input.getPrices() != null) {
result = new DefaultInternationalPrice();
result.setPrices(toDefaultPrices(ImmutableList.copyOf(input.getPrices())));
}
