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
This commit is contained in:
Michael Bayne
2004-07-09 04:00:20 +00:00
parent 19abac5be1
commit 55df96a644
@@ -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);
}