You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by mr...@apache.org on 2004/12/22 04:23:19 UTC

svn commit: r123034 - /struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java

Author: mrdon
Date: Tue Dec 21 19:23:17 2004
New Revision: 123034

URL: http://svn.apache.org/viewcvs?view=rev&rev=123034
Log:
Bug 32661 NPE in ModuleUtils.selectModule - patch submitted by Rich Feit
 

Modified:
   struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java

Modified: struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java
Url: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java?view=diff&rev=123034&p1=struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java&r1=123033&p2=struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java&r2=123034
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java	(original)
+++ struts/core/trunk/src/share/org/apache/struts/util/ModuleUtils.java	Tue Dec 21 19:23:17 2004
@@ -241,20 +241,19 @@
 
         if (config != null) {
             request.setAttribute(Globals.MODULE_KEY, config);
+            MessageResourcesConfig[] mrConfig = config.findMessageResourcesConfigs();
+            for(int i = 0; i < mrConfig.length; i++) {
+                String key = mrConfig[i].getKey();
+                MessageResources resources =
+                    (MessageResources) context.getAttribute(key + prefix);
+                if (resources != null) {
+                    request.setAttribute(key, resources);
+                } else {
+                    request.removeAttribute(key);
+                }    
+            }
         } else {
             request.removeAttribute(Globals.MODULE_KEY);
-        }
-
-        MessageResourcesConfig[] mrConfig = config.findMessageResourcesConfigs();
-        for(int i = 0; i < mrConfig.length; i++) {
-          String key = mrConfig[i].getKey();
-          MessageResources resources =
-            (MessageResources) context.getAttribute(key + prefix);
-          if (resources != null) {
-              request.setAttribute(key, resources);
-          } else {
-              request.removeAttribute(key);
-          }
         }
     }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org