mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-07 00:23:20 +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);
|
var a = this.getAchievement(i);
|
||||||
|
if(a == null) {
|
||||||
|
Grasscutter.getLogger().warn("null returned while getting achievement!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
a.setStatus(Status.STATUS_REWARD_TAKEN);
|
a.setStatus(Status.STATUS_REWARD_TAKEN);
|
||||||
this.save();
|
this.save();
|
||||||
this.sendUpdatePacket(a);
|
this.sendUpdatePacket(a);
|
||||||
|
@ -25,7 +25,7 @@ public class AllActivityConditionBuilder {
|
|||||||
private Map<ActivityConditions, ActivityConditionBaseHandler> initActivityConditions() {
|
private Map<ActivityConditions, ActivityConditionBaseHandler> initActivityConditions() {
|
||||||
Reflections reflector = Grasscutter.reflector;
|
Reflections reflector = Grasscutter.reflector;
|
||||||
return reflector.getTypesAnnotatedWith(ActivityCondition.class).stream()
|
return reflector.getTypesAnnotatedWith(ActivityCondition.class).stream()
|
||||||
.map(this::newInstance)
|
.map(this::newInstance).filter(Objects::nonNull)
|
||||||
.map(h -> new AbstractMap.SimpleEntry<>(extractActionType(h), h))
|
.map(h -> new AbstractMap.SimpleEntry<>(extractActionType(h), h))
|
||||||
.collect(
|
.collect(
|
||||||
Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue));
|
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();
|
return Files.getLastModifiedTime(path).toMillis();
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
Grasscutter.getLogger()
|
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
|
return Long.MAX_VALUE; // Don't use cache, something has gone wrong
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user