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:
@@ -255,10 +255,12 @@ public class ButtonSprite extends Sprite
|
|||||||
// lay out the label if not already
|
// lay out the label if not already
|
||||||
if (!_label.isLaidOut()) {
|
if (!_label.isLaidOut()) {
|
||||||
Graphics2D gfx = _mgr.createGraphics();
|
Graphics2D gfx = _mgr.createGraphics();
|
||||||
try {
|
if (gfx != null) {
|
||||||
_label.layout(gfx);
|
try {
|
||||||
} finally {
|
_label.layout(gfx);
|
||||||
gfx.dispose();
|
} finally {
|
||||||
|
gfx.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user