Skip to content

Commit

Permalink
fixed potentially null result in nonnull function getCachedPalette
Browse files Browse the repository at this point in the history
  • Loading branch information
ImplementsLegend committed Apr 8, 2024
1 parent ab7637e commit b014b8f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public Palette getCachedPalette(ProcessorContext context) {//this could break wh
if (cachedVersion==null || cachedPalette==null || !lastVault.refersTo(context.getVault())) {
lastVault = new PhantomReference<>(context.getVault(),null);
Version version = context.getVault() == null ? Version.latest() : (Version)context.getVault().get(Vault.VERSION);
if(version!=cachedVersion){
if(version!=cachedVersion || palette==null){
cachedVersion=version;
palette = VaultRegistry.PALETTE.getKey(this.id).get(version);
palette = VaultRegistry.PALETTE.getKey(this.id).get(version);
cachedPalette=palette;
}
}
Expand Down

0 comments on commit b014b8f

Please sign in to comment.