Skip to content

Commit

Permalink
Set Default Value if is null (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou9584 authored Feb 8, 2023
1 parent dcd69bd commit 51736a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public List<Exception> doActions(@NotNull DeviceManager deviceManager, @NotNull
@NotNull Map<String, List<DeviceAction>> actions, @NotNull String when) {
List<Exception> exceptions = new ArrayList<>();
//filter todoActions
List<DeviceAction> todoActions = actions.get(when).stream().filter(deviceAction -> actionTypes.contains(deviceAction.getMethod())).collect(Collectors.toList());
List<DeviceAction> todoActions = actions.getOrDefault(when, new ArrayList<>()).stream().filter(deviceAction -> actionTypes.contains(deviceAction.getMethod())).collect(Collectors.toList());

logger.info("Start to execute actions! Current timing is {}, action size is {}", when, todoActions.size());
for (DeviceAction deviceAction : todoActions) {
Expand Down

0 comments on commit 51736a4

Please sign in to comment.