[FIX] OptionalView.fixDependencies throw out of range

This commit is contained in:
Gravita 2024-07-08 21:29:40 +07:00
parent 1bebd8de2c
commit ec526a343d
No known key found for this signature in database
GPG key ID: 543A8F335C9CD633

View file

@ -88,7 +88,7 @@ public Set<OptionalAction> getEnabledActions() {
public void fixDependencies() {
Set<OptionalFile> disabled = all.stream().filter(t -> !isEnabled(t)).collect(Collectors.toSet());
for (OptionalFile file : disabled) {
if (file.group != null && Arrays.stream(file.group).noneMatch(this::isEnabled)) {
if (file.group != null && file.group.length > 0 && Arrays.stream(file.group).noneMatch(this::isEnabled)) {
enable(file.group[0], false, null);
}
}