refactor: fix nullable params

This commit is contained in:
Breno A.
2024-06-09 10:26:58 -03:00
Unverified
parent 3b68645330
commit d4ce7aac08
4 changed files with 279 additions and 384 deletions
@@ -25,7 +25,7 @@ public class AllActivityConditionBuilder {
private Map<ActivityConditions, ActivityConditionBaseHandler> initActivityConditions() {
Reflections reflector = Grasscutter.reflector;
return reflector.getTypesAnnotatedWith(ActivityCondition.class).stream()
.map(this::newInstance)
.map(this::newInstance).filter(Objects::nonNull)
.map(h -> new AbstractMap.SimpleEntry<>(extractActionType(h), h))
.collect(
Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue));