[Lada-commits] [PATCH 3 of 4] Avoid NPE on trying to delete non-existent Probe object

Wald Commits scm-commit at wald.intevation.org
Mon Oct 31 18:10:52 CET 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1477930489 -3600
# Node ID f9328849a53c243d9f85aaa09f7abc237eb24cf3
# Parent  960248dd98c377565b361b58a9ea8dbee7d79783
Avoid NPE on trying to delete non-existent Probe object.

diff -r 960248dd98c3 -r f9328849a53c src/main/java/de/intevation/lada/rest/ProbeService.java
--- a/src/main/java/de/intevation/lada/rest/ProbeService.java	Mon Oct 31 15:50:05 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/ProbeService.java	Mon Oct 31 17:14:49 2016 +0100
@@ -498,6 +498,9 @@
         /* Get the probe object by id*/
         Response probe =
             repository.getById(Probe.class, Integer.valueOf(id), "land");
+        if (!probe.getSuccess()) {
+            return probe;
+        }
         Probe probeObj = (Probe)probe.getData();
         if (!authorization.isAuthorized(
                 request,


More information about the Lada-commits mailing list