From 55df96a64417dff62d07ea90711a9ce82953ccff Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 9 Jul 2004 04:00:20 +0000 Subject: [PATCH] Throw an informative exception in this circumstance. The NPE that would follow doesn't tell us anything about the hosed tileset. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3053 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/tile/TileSet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/media/tile/TileSet.java b/src/java/com/threerings/media/tile/TileSet.java index 537c9d668..e1036f3eb 100644 --- a/src/java/com/threerings/media/tile/TileSet.java +++ b/src/java/com/threerings/media/tile/TileSet.java @@ -1,5 +1,5 @@ // -// $Id: TileSet.java,v 1.59 2004/02/25 14:43:17 mdb Exp $ +// $Id: TileSet.java,v 1.60 2004/07/09 04:00:20 mdb Exp $ package com.threerings.media.tile; @@ -272,6 +272,9 @@ public abstract class TileSet checkTileIndex(tileIndex); Rectangle bounds = computeTileBounds(tileIndex); BufferedImage timg = getRawTileSetImage(); + if (timg == null) { + throw new IllegalStateException("Missing source image " + this); + } return timg.getSubimage(bounds.x, bounds.y, bounds.width, bounds.height); }