diff src/main/java/de/intevation/lada/rest/ProbeService.java @ 1125:f9328849a53c

Avoid NPE on trying to delete non-existent Probe object.
author Tom Gottfried <tom@intevation.de>
date Mon, 31 Oct 2016 17:14:49 +0100
parents 186d602e031a
children 14876c62f692
line wrap: on
line diff
--- 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,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)