[Lada-commits] [PATCH] Avoid NPE in status service
Wald Commits
scm-commit at wald.intevation.org
Tue May 10 15:55:29 CEST 2016
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1462888526 -7200
# Node ID dfb0d6f2b140bf0da8f42430eb841f92e4cba39c
# Parent e134c13c4209521cbbe9c4661993fb5249e334d0
Avoid NPE in status service.
diff -r e134c13c4209 -r dfb0d6f2b140 src/main/java/de/intevation/lada/rest/StatusService.java
--- 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");
More information about the Lada-commits
mailing list