Prevented NPEs if Asset linked to CustomImageObject is null
This commit is contained in:
@@ -88,7 +88,7 @@ public class CustomImageObject implements GuiEntryListEntry {
|
||||
}
|
||||
}
|
||||
|
||||
if(!ResourceHelper.isRegistered(resourceLocation)) {
|
||||
if(resourceLocation != null && !ResourceHelper.isRegistered(resourceLocation)) {
|
||||
ResourceHelper.registerResource(resourceLocation);
|
||||
Minecraft.getMinecraft().getTextureManager().loadTexture(resourceLocation, dynamicTexture);
|
||||
dynamicTexture.updateDynamicTexture();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ReplayImageAsset implements ReplayAsset<BufferedImage> {
|
||||
ResourceHelper.freeResource(previewResource);
|
||||
|
||||
for(CustomImageObject object : ReplayHandler.getCustomImageObjects()) {
|
||||
if(object.getLinkedAsset().equals(ReplayHandler.getAssetRepository().getUUIDForAsset(this))) {
|
||||
if(object.getLinkedAsset() != null && object.getLinkedAsset().equals(ReplayHandler.getAssetRepository().getUUIDForAsset(this))) {
|
||||
object.setImage(this.object);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user