From 4e24a63fa9360ac3b8e909c34a652cbbe439b757 Mon Sep 17 00:00:00 2001 From: Jove Zhong Date: Mon, 15 Feb 2016 22:50:54 +0800 Subject: [PATCH] avoid NullPointerException for invalid AZ --- src/java/com/netflix/ice/basic/BasicReservationService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/com/netflix/ice/basic/BasicReservationService.java b/src/java/com/netflix/ice/basic/BasicReservationService.java index 7a34ea4d..bce23d04 100644 --- a/src/java/com/netflix/ice/basic/BasicReservationService.java +++ b/src/java/com/netflix/ice/basic/BasicReservationService.java @@ -172,8 +172,10 @@ private void pollAPI() throws Exception { } UsageType usageType = getUsageType(offer.getInstanceType(), offer.getProductDescription()); // Unknown Zone - if (Zone.getZone(offer.getAvailabilityZone()) == null) + if (Zone.getZone(offer.getAvailabilityZone()) == null){ logger.error("No Zone for " + offer.getAvailabilityZone()); + continue; + } hasNewPrice = setPrice(utilization, currentTime, Zone.getZone(offer.getAvailabilityZone()).region, usageType, offer.getFixedPrice(), hourly) || hasNewPrice;