How to fix try/catch Java NullPointerException
I am trying to create a 2D platform game, by following this tutorial. I have created an Images()-class which looks like this: package Resources; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Objects; public class Images { public static BufferedImage[] tileBlocks; public Images(){ tileBlocks = new BufferedImage[1]; try{ tileBlocks[0] = ImageIO.read( // TODO: Fix the error… Read More How to fix try/catch Java NullPointerException