Update of 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions
In directory james.mmbase.org:/tmp/cvs-serv6959

Modified Files:
      Tag: MMBase-1_8
        Functions.java 
Log Message:
it's better to fail sooner than later


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions


Index: Functions.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/functions/Functions.java,v
retrieving revision 1.15.2.4
retrieving revision 1.15.2.5
diff -u -b -r1.15.2.4 -r1.15.2.5
--- Functions.java      14 Mar 2008 15:35:48 -0000      1.15.2.4
+++ Functions.java      25 Mar 2008 11:31:54 -0000      1.15.2.5
@@ -39,7 +39,7 @@
 </mm:cloud>
  * @author  Michiel Meeuwissen
  * @since   MMBase-1.8
- * @version $Id: Functions.java,v 1.15.2.4 2008/03/14 15:35:48 michiel Exp $
+ * @version $Id: Functions.java,v 1.15.2.5 2008/03/25 11:31:54 michiel Exp $
  * @todo    EXPERIMENTAL
  */
 public class Functions {
@@ -135,9 +135,10 @@
      * @since MMBase-1.8.4
      */
     public static String treefile(String page, javax.servlet.jsp.PageContext 
pageContext,  Object objectList) throws javax.servlet.jsp.JspTagException, 
java.io.IOException {
-        org.mmbase.bridge.jsp.taglib.pageflow.TreeHelper th =
-            new org.mmbase.bridge.jsp.taglib.pageflow.TreeHelper();
-        th.setCloud((Cloud) pageContext.getAttribute(CloudTag.KEY, 
CloudTag.SCOPE));
+        Cloud cloud = (Cloud) pageContext.getAttribute(CloudTag.KEY, 
CloudTag.SCOPE);
+        if (cloud == null) throw new IllegalStateException("No current cloud 
(key '" + CloudTag.KEY + "', can not execute treefile");
+        org.mmbase.bridge.jsp.taglib.pageflow.TreeHelper th = new 
org.mmbase.bridge.jsp.taglib.pageflow.TreeHelper();
+        th.setCloud(cloud);
         javax.servlet.http.HttpServletRequest req = 
(javax.servlet.http.HttpServletRequest) pageContext.getRequest();
         String t = th.findTreeFile(page, Casting.toString(objectList), 
pageContext.getSession());
         if (t == null || "".equals(t)) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to