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
|
||||
if (!_label.isLaidOut()) {
|
||||
Graphics2D gfx = _mgr.createGraphics();
|
||||
try {
|
||||
_label.layout(gfx);
|
||||
} finally {
|
||||
gfx.dispose();
|
||||
if (gfx != null) {
|
||||
try {
|
||||
_label.layout(gfx);
|
||||
} finally {
|
||||
gfx.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user