Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1340 - trunk/src/org/tigris/gef/presentation/FigText.java

gef
Discussion topic

Back to topic list

svn commit: r1340 - trunk/src/org/tigris/gef/presentation/FigText.java

Author bobtarling
Full name Bob Tarling
Date 2012-05-17 23:55:10 PDT
Message Author: bobtarling
Date: 2012-05-17 23:55:09-0700
New Revision: 1340

Modified:
   trunk/src/org/tigris​/gef/presentation/Fi​gText.java

Log:
Protect against NPE reported in argo issue 6433

Modified: trunk/src/org/tigris​/gef/presentation/Fi​gText.java
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/presentation/Fi​gText.java?view=diff​&pathrev=1340​&r1=1339&r2=134​0
====================​====================​====================​==================
--- trunk/src/org/tigris​/gef/presentation/Fi​gText.java (original)
+++ trunk/src/org/tigris​/gef/presentation/Fi​gText.java 2012-05-17 23:55:09-0700
@@ -908,6 +908,11 @@
         int numLines = 1;
         StringTokenizer lines = new StringTokenizer(_curText, "" + HARD_RETURN
                 + SOFT_RETURN, true);
+
+ if (_fm == null) {
+ _fm = new JLabel().getFontMetrics(_font);
+ }
+
         while (lines.hasMoreTokens()) {
             String curLine = lines.nextToken();
             int chunkW = _fm.stringWidth(curLine);

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1340 - trunk/src/org/tigris/gef/presentation/FigText.java bobtarling Bob Tarling 2012-05-17 23:55:10 PDT
Messages per page: