Skip to content

Commit

Permalink
修复获取完整属性可能npe问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Sep 14, 2022
1 parent b606e5d commit 5393e30
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ default Optional<Long> getPropertySourceTime(@Nonnull String property) {
if (CollectionUtils.isEmpty(sourceTime)) {
return Optional.empty();
}
return Optional.of(sourceTime.get(property));
return Optional.ofNullable(sourceTime.get(property));
}

/**
Expand All @@ -82,7 +82,7 @@ default Optional<String> getPropertyState(@Nonnull String property){
if (CollectionUtils.isEmpty(states)) {
return Optional.empty();
}
return Optional.of(states.get(property));
return Optional.ofNullable(states.get(property));
}

/**
Expand Down

0 comments on commit 5393e30

Please # to comment.