This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b33041d2a FIX-3732: Prevent possible IAE in DocumentViewOp.
0b33041d2a is described below

commit 0b33041d2a20a4b5e6ae548711787ff76fc6ba22
Author: Laszlo Kishalmi <laszlo.kisha...@gmail.com>
AuthorDate: Sun Sep 11 08:30:48 2022 -0700

    FIX-3732: Prevent possible IAE in DocumentViewOp.
---
 .../src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java 
b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
index 06cbd5a31f..7475b0937d 100644
--- 
a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
+++ 
b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
@@ -1391,7 +1391,7 @@ public final class DocumentViewOp
 
     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);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to