Only resolve inheritances for groups which exist already

This commit is contained in:
Luck 2017-06-04 16:41:20 +01:00
parent 7b8654339c
commit 2ecaa39cb6
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -105,7 +105,11 @@ public class SpongeGroup extends Group {
.map(LocalizedNode::getNode)
.filter(Node::isGroupNode)
.map(Node::getGroupName)
.map(s -> getPlugin().getService().getGroupSubjects().loadSubject(s).join())
.distinct()
.map(n -> Optional.ofNullable(getPlugin().getGroupManager().getIfLoaded(n)))
.filter(Optional::isPresent)
.map(Optional::get)
.map(SpongeGroup::sponge)
.map(LPSubject::toReference)
.collect(Collectors.toSet());