[wolfsmartset] Fix NullPointerException when updating values (#11931)

* fix bug #11930 NullPointerException

Signed-off-by: Bo Biene <openhab.github@biene.eu>
This commit is contained in:
Bo Biene 2022-01-02 16:51:51 +01:00 committed by GitHub
parent ef2454cd82
commit 6deb3f56da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -53,8 +53,8 @@ public class GetParameterValuesDTO {
this.values = values;
}
public Boolean getIsNewJobCreated() {
return isNewJobCreated;
public boolean getIsNewJobCreated() {
return isNewJobCreated != null ? isNewJobCreated : false;
}
public void setIsNewJobCreated(Boolean isNewJobCreated) {

View File

@ -184,7 +184,7 @@ public class WolfSmartsetUnitThingHandler extends BaseThingHandler {
*/
public void updateValues(@Nullable GetParameterValuesDTO values) {
var thingId = thing.getUID();
if (values != null && values.getValues() != null && values.getValues().size() > 0) {
if (values != null && values.getValues() != null && !values.getValues().isEmpty()) {
if (!values.getIsNewJobCreated()) {
lastRefreshTime = Instant.now();
}