myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r920828 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
Date Tue, 09 Mar 2010 12:23:41 GMT
Author: lofwyr
Date: Tue Mar  9 12:23:40 2010
New Revision: 920828

URL: http://svn.apache.org/viewvc?rev=920828&view=rev
Log:
TOBAOG-606: Make Measure.add robust against NullPointerExceptions

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java?rev=920828&r1=920827&r2=920828&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
Tue Mar  9 12:23:40 2010
@@ -51,7 +51,11 @@ public final class PixelMeasure extends 
   }
   
   public Measure add(Measure m) {
-    return pixelValueOf(pixel + m.getPixel());
+    if (m == null) {
+      return this;
+    } else {
+      return pixelValueOf(pixel + m.getPixel());
+    }
   }
 
   public Measure add(int m) {



Mime
View raw message