Browse code

settings: ignore null value for settings on db update

Anthony Prades authored on 08/02/2016 10:52:01
Showing 1 changed files
... ...
@@ -38,7 +38,7 @@ public class SettingHome {
38 38
 
39 39
 	private Logger logger = LoggerFactory.getLogger(getClass());
40 40
 
41
-	private final BmHelper bmh; 
41
+	private final BmHelper bmh;
42 42
 
43 43
 	private static SettingHome instance = new SettingHome(BmHelper.get());
44 44
 
... ...
@@ -371,6 +371,10 @@ public class SettingHome {
371 371
 				String qInsert = "INSERT INTO pref (eid, option, value) VALUES (?, ?, ?)";
372 372
 				ps = con.prepareStatement(qInsert);
373 373
 				for (String key : settings.keySet()) {
374
+					if (settings.get(key) == null) {
375
+						continue;
376
+					}
377
+
374 378
 					int idx = 1;
375 379
 					ps.setInt(idx++, entityId);
376 380
 					ps.setString(idx++, key);