mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:32:55 +08:00
refactor: fix nullable params
This commit is contained in:
parent
3b68645330
commit
d4ce7aac08
@ -231,6 +231,10 @@ public class Achievements {
|
||||
});
|
||||
|
||||
var a = this.getAchievement(i);
|
||||
if(a == null) {
|
||||
Grasscutter.getLogger().warn("null returned while getting achievement!");
|
||||
return;
|
||||
}
|
||||
a.setStatus(Status.STATUS_REWARD_TAKEN);
|
||||
this.save();
|
||||
this.sendUpdatePacket(a);
|
||||
|
@ -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));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -347,7 +347,7 @@ public final class Language {
|
||||
return Files.getLastModifiedTime(path).toMillis();
|
||||
} catch (Exception ignored) {
|
||||
Grasscutter.getLogger()
|
||||
.debug("Exception while checking modified time: ", path);
|
||||
.debug("Exception while checking modified time: {}", path);
|
||||
return Long.MAX_VALUE; // Don't use cache, something has gone wrong
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user