RT-15096: IAE when pressing spacebar in TextArea diff -r 39481ba13918 -r 2c60320ad6ee javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java --- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java Fri Sep 02 18:13:06 2011 +0100 +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextAreaSkin.java Fri Sep 02 13:35:27 2011 -0700 @@ -636,7 +636,7 @@ width = 0; } - return new Rectangle2D(x, y, width, height); + return (width >= 0 && height >= 0) ? new Rectangle2D(x, y, width, height) : null; } @Override public void scrollCharacterToVisible(final int index) { @@ -651,7 +651,9 @@ return; } Rectangle2D characterBounds = getCharacterBounds(index); - scrollBoundsToVisible(characterBounds); + if (characterBounds != null) { + scrollBoundsToVisible(characterBounds); + } } }); }