Skip to content

Commit

Permalink
Create empty TeltonikaParameterMap if it doesn't exist already
Browse files Browse the repository at this point in the history
  • Loading branch information
pankalog committed Jan 15, 2024
1 parent 58f7412 commit 1eb1517
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.openremote.model.value.ValueType;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -66,7 +67,7 @@ public CustomValueTypes.TeltonikaParameterMap getParameterMap() {
Optional<Attribute<CustomValueTypes.TeltonikaParameterMap>> map = getAttributes().get(PARAMETER_MAP);

return map.flatMap(Attribute::getValue)
.orElse(null); // or provide a default value other than null, if appropriate
.orElse(new CustomValueTypes.TeltonikaParameterMap()); // or provide a default value other than null, if appropriate
}

}

0 comments on commit 1eb1517

Please sign in to comment.