changeset 940:dfb0d6f2b140

Avoid NPE in status service.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 May 2016 15:55:26 +0200
parents e134c13c4209
children cefa1060b619
files src/main/java/de/intevation/lada/rest/StatusService.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/StatusService.java	Tue May 10 13:22:36 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/StatusService.java	Tue May 10 15:55:26 2016 +0200
@@ -428,7 +428,12 @@
         statusNew.setDatum(new Timestamp(new Date().getTime()));
         statusNew.setErzeuger(status.getErzeuger());
         statusNew.setMessungsId(status.getMessungsId());
-        statusNew.setStatusStufe(status.getStatusStufe());
+        if (status.getStatusStufe() == null) {
+            statusNew.setStatusStufe(currentStatus.getStatusStufe());
+        }
+        else {
+            statusNew.setStatusStufe(status.getStatusStufe());
+        }
         statusNew.setStatusWert(8);
         statusNew.setText("Reset");
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)