Skip to content

Commit

Permalink
修改空broker列表查询报错
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazy committed Oct 15, 2020
1 parent 1d2a271 commit 99fe180
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ public int deleteByGroupId(long groupId) {

@Override
public Map<Long, Identity> findGroupByBrokerIds(List<Long> brokerIds) {
List<BrokerGroupRelated> brokerGroupRelateds = repository.findByBrokerIds(brokerIds);
if (CollectionUtils.isNotEmpty(brokerGroupRelateds)) {
return brokerGroupRelateds.stream()
.filter(brokerGroupRelated -> brokerGroupRelated.getGroup() != null)
.collect(Collectors.toMap(BrokerGroupRelated::getId,
BrokerGroupRelated::getGroup));
if (CollectionUtils.isNotEmpty(brokerIds)) {
List<BrokerGroupRelated> brokerGroupRelateds = repository.findByBrokerIds(brokerIds);
if (CollectionUtils.isNotEmpty(brokerGroupRelateds)) {
return brokerGroupRelateds.stream()
.filter(brokerGroupRelated -> brokerGroupRelated.getGroup() != null)
.collect(Collectors.toMap(BrokerGroupRelated::getId,
BrokerGroupRelated::getGroup));
}
}
return Collections.emptyMap();
}
Expand Down

0 comments on commit 99fe180

Please sign in to comment.