svn commit: r941139 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r941139 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java

lektran
Author: lektran
Date: Wed May  5 02:25:26 2010
New Revision: 941139

URL: http://svn.apache.org/viewvc?rev=941139&view=rev
Log:
Put the null check a little higher so that it actually does the check before an NPE can occur. Giving up on this transform, I hate the content component.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java?rev=941139&r1=941138&r2=941139&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/MenuWrapTransform.java Wed May  5 02:25:26 2010
@@ -182,13 +182,15 @@ public class MenuWrapTransform implement
                 String menuName = (String)templateCtx.get("menuName");
                 String menuWrapperClassName = (String)templateCtx.get("menuWrapperClassName");
                 HtmlMenuWrapper menuWrapper = HtmlMenuWrapper.getMenuWrapper(request, response, session, menuDefFile, menuName, menuWrapperClassName);
-                String associatedContentId = (String)templateCtx.get("associatedContentId");
-                menuWrapper.putInContext("defaultAssociatedContentId", associatedContentId);
-                menuWrapper.putInContext("currentValue", view);
 
                 if (menuWrapper == null) {
                     throw new IOException("HtmlMenuWrapper with def file:" + menuDefFile + " menuName:" + menuName + " and HtmlMenuWrapper class:" + menuWrapperClassName + " could not be instantiated.");
                 }
+
+                String associatedContentId = (String)templateCtx.get("associatedContentId");
+                menuWrapper.putInContext("defaultAssociatedContentId", associatedContentId);
+                menuWrapper.putInContext("currentValue", view);
+
                 String menuStr = menuWrapper.renderMenuString();
                 out.write(menuStr);
             }