diff --git a/src/main/java/org/jetlinks/core/message/property/PropertyMessage.java b/src/main/java/org/jetlinks/core/message/property/PropertyMessage.java index d1ca7dc3..9f0f124e 100644 --- a/src/main/java/org/jetlinks/core/message/property/PropertyMessage.java +++ b/src/main/java/org/jetlinks/core/message/property/PropertyMessage.java @@ -68,7 +68,7 @@ default Optional getPropertySourceTime(@Nonnull String property) { if (CollectionUtils.isEmpty(sourceTime)) { return Optional.empty(); } - return Optional.of(sourceTime.get(property)); + return Optional.ofNullable(sourceTime.get(property)); } /** @@ -82,7 +82,7 @@ default Optional getPropertyState(@Nonnull String property){ if (CollectionUtils.isEmpty(states)) { return Optional.empty(); } - return Optional.of(states.get(property)); + return Optional.ofNullable(states.get(property)); } /**