mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Return null for invalid resources rather than the missing texture (avoids de-allocating the missing texture's image)
This commit is contained in:
parent
310e713d71
commit
857e06198a
1 changed files with 3 additions and 2 deletions
|
@ -92,9 +92,10 @@ public class Pony implements IPony {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static NativeImage getBufferedImage(@Nullable Identifier resource) {
|
||||
if (resource == null) {
|
||||
return MissingSprite.getMissingSpriteTexture().getImage();
|
||||
return null;
|
||||
}
|
||||
|
||||
MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
@ -126,7 +127,7 @@ public class Pony implements IPony {
|
|||
// or buffer contained no/invalid image
|
||||
MineLittlePony.logger.fatal("Could not load texture from GL memory", e);
|
||||
|
||||
return MissingSprite.getMissingSpriteTexture().getImage();
|
||||
return null;
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue