myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1794078 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java
Date Fri, 05 May 2017 17:17:36 GMT
Author: lofwyr
Date: Fri May  5 17:17:36 2017
New Revision: 1794078

URL: http://svn.apache.org/viewvc?rev=1794078&view=rev
Log:
TOBAGO-1738: No UIComponents for <tc:script> and <tc:style>.
* fixing possible NPE

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java?rev=1794078&r1=1794077&r2=1794078&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/CustomClass.java
Fri May  5 17:17:36 2017
@@ -51,13 +51,20 @@ public class CustomClass implements CssI
 
   @Override
   public String getName() {
-    String string;
+    final String string;
     if (name != null) {
       string = name;
-    } else {
+    } else if (valueExpression != null) {
       final FacesContext facesContext = FacesContext.getCurrentInstance();
       final ELContext elContext = facesContext.getELContext();
-      string = valueExpression.getValue(elContext).toString();
+      final Object valueExpressionValue = valueExpression.getValue(elContext);
+      if (valueExpressionValue != null) {
+        string = valueExpressionValue.toString();
+      } else {
+        return "";
+      }
+    } else {
+      return "";
     }
 
     final StringTokenizer tokenizer = new StringTokenizer(string, " ");



Mime
View raw message