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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user