Permanently fix #34 (NPE)

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2019-10-28 07:15:32 -06:00
rodzic a81bc7a62b
commit 21a76831b0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -59,10 +59,16 @@ public final class MapWithAIAvailability {
.filter(entry -> "objects".equals(entry.getKey())).findFirst();
if (objects.isPresent()) {
final JsonObject value = objects.get().getValue().asJsonObject();
final JsonObject centroid = value.getJsonObject("rapid_releases_points");
final JsonArray countries = centroid.getJsonArray("geometries");
COUNTRIES.clear();
COUNTRIES.putAll(parseForCountries(countries));
if (value != null) {
final JsonObject centroid = value.getJsonObject("rapid_releases_points");
if (centroid != null) {
final JsonArray countries = centroid.getJsonArray("geometries");
if (countries != null) {
COUNTRIES.clear();
COUNTRIES.putAll(parseForCountries(countries));
}
}
}
}
} catch (IOException e) {
Logging.debug(e);