File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/io/izzel/mesmerize/impl/service Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public class SimpleStatsService implements StatsService {
49
49
50
50
private final CacheLoader <Entity , StatsSet > cacheLoader = entity -> {
51
51
if (!entity .isValid () || entity .isDead ()) {
52
- return new StatsSet () ;
52
+ return null ;
53
53
}
54
54
Callable <StatsSet > callable = () -> {
55
55
StatsSet statsSet = new StatsSet ();
@@ -94,15 +94,17 @@ public StatsSet cachedSetFor(@NotNull Entity entity) {
94
94
if (!Bukkit .isPrimaryThread ()) {
95
95
throw new IllegalStateException ("async stats get" );
96
96
}
97
+ StatsSet set ;
97
98
if (entityLock .contains (entity .getEntityId ())) {
98
99
try {
99
- return cacheLoader .load (entity );
100
+ set = cacheLoader .load (entity );
100
101
} catch (Exception e ) {
101
102
throw new RuntimeException (e );
102
103
}
103
104
} else {
104
- return statsSetCache .get (entity );
105
+ set = statsSetCache .get (entity );
105
106
}
107
+ return set == null ? new StatsSet () : set ;
106
108
}
107
109
108
110
@ Override
You can’t perform that action at this time.
0 commit comments