From 187f17fb481e3a61e09d5a6bd629f07f8aa60d04 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Fri, 17 Jan 2020 11:02:46 -0500 Subject: [PATCH] avoid NPE looking up geo when not activated --- bubble-server/src/main/java/bubble/service/cloud/GeoService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bubble-server/src/main/java/bubble/service/cloud/GeoService.java b/bubble-server/src/main/java/bubble/service/cloud/GeoService.java index ab33b350..558a986f 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/GeoService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/GeoService.java @@ -174,6 +174,7 @@ public class GeoService { if (found != null) return json(found, GeoTimeZone.class); if (acct.get() == null) acct.set(accountDAO.getFirstAdmin()); + if (acct.get() == null) throw new SimpleViolationException("err.activation.required"); List geoServices = cloudDAO.findByAccountAndType(acct.get().getUuid(), CloudServiceType.geoTime); if (geoServices.isEmpty() && !account.admin()) { // try to find using admin