incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r477247 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
Date Mon, 20 Nov 2006 16:40:08 GMT
Author: jwaldman
Date: Mon Nov 20 08:40:08 2006
New Revision: 477247

URL: http://svn.apache.org/viewvc?view=rev&rev=477247
Log:
fix NPE bug that happens when there is no WEB-INF/trinidad-skins.xml file. I was testing the
code with this file, and didn't notice the NPE potential.

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java?view=diff&rev=477247&r1=477246&r2=477247
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
Mon Nov 20 08:40:08 2006
@@ -307,14 +307,17 @@
     
     // Add WEB-INF/trinidad-skins.xml skins to skin factory. (sorted first)    
     SkinsNode webInfSkinsNode = _getWebInfSkinsNode(context);
-    List<SkinNode> webInfSkinNodes = webInfSkinsNode.getSkinNodes();
-
-    List<SkinNode> sortedWebInfSkinNodes = _sortSkinNodes(skinFactory, webInfSkinNodes);
-    
-    // register skins found in webInfSkinNodes
-    for (SkinNode skinNode : sortedWebInfSkinNodes)
+    if (webInfSkinsNode != null)
     {
-      _addSkinToFactory(skinFactory, skinNode, false);
+      List<SkinNode> webInfSkinNodes = webInfSkinsNode.getSkinNodes();
+  
+      List<SkinNode> sortedWebInfSkinNodes = _sortSkinNodes(skinFactory, webInfSkinNodes);
+      
+      // register skins found in webInfSkinNodes
+      for (SkinNode skinNode : sortedWebInfSkinNodes)
+      {
+        _addSkinToFactory(skinFactory, skinNode, false);
+      }
     }
     
     // register all the skin additions from META-INF trinidad-skins.xml and WEB-INF
@@ -328,8 +331,11 @@
       _registerSkinAdditions(fContext, skinFactory, skinAdditionNodeList, true);    
     } 
     // register skin-additions from WEB-INF/trinidad-skins.xml file
-    List<SkinAdditionNode> skinAdditionNodeList = webInfSkinsNode.getSkinAdditionNodes();
-    _registerSkinAdditions(fContext, skinFactory, skinAdditionNodeList, false);    
+    if (webInfSkinsNode != null)
+    {
+      List<SkinAdditionNode> skinAdditionNodeList = webInfSkinsNode.getSkinAdditionNodes();
+      _registerSkinAdditions(fContext, skinFactory, skinAdditionNodeList, false);    
+    }
     
   }
   



Mime
View raw message