Skip to content

Commit

Permalink
FIX-3732: Prevent possible IAE in DocumentViewOp.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkishalmi committed Sep 11, 2022
1 parent 099a506 commit 0b33041
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ public FontInfo getFontInfo(Font font) {

TextLayout createTextLayout(String text, Font font) {
checkSettingsInfo();
if (fontRenderContext != null && font != null) {
if (fontRenderContext != null && font != null && text.length() > 0) {
ViewStats.incrementTextLayoutCreated(text.length());
FontInfo fontInfo = getFontInfo(font);
TextLayout textLayout = new TextLayout(text, fontInfo.renderFont, fontRenderContext);
Expand Down

0 comments on commit 0b33041

Please sign in to comment.