Protect from an NPE if we find no graphics yet at sprite initialization time.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@106 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mike Thomas
2006-12-20 20:05:09 +00:00
parent 45c75b5039
commit 71259f2ceb
@@ -255,10 +255,12 @@ public class ButtonSprite extends Sprite
// lay out the label if not already
if (!_label.isLaidOut()) {
Graphics2D gfx = _mgr.createGraphics();
try {
_label.layout(gfx);
} finally {
gfx.dispose();
if (gfx != null) {
try {
_label.layout(gfx);
} finally {
gfx.dispose();
}
}
}