changeset 883:2e264556f186

Avoid NPE by rejecting invalid requests.
author Tom Gottfried <tom@intevation.de>
date Fri, 12 Feb 2016 14:22:53 +0100
parents 2e9007297e78
children fa7278bd8d73
files src/main/java/de/intevation/lada/rest/StatusService.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/StatusService.java	Fri Feb 12 12:10:09 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/StatusService.java	Fri Feb 12 14:22:53 2016 +0100
@@ -223,6 +223,13 @@
         @Context HttpServletRequest request,
         LStatusProtokoll status
     ) {
+        if (status.getMessungsId() == null
+            || status.getErzeuger() == null
+            || status.getStatusWert() == null
+        ) {
+            return new Response(false, 631, null);
+        }
+
         UserInfo userInfo = authorization.getInfo(request);
         LMessung messung = defaultRepo.getByIdPlain(
             LMessung.class, status.getMessungsId(), "land");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)