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

Modified Files:
        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.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- Functions.java      17 Mar 2008 16:18:15 -0000      1.25
+++ Functions.java      25 Mar 2008 11:32:52 -0000      1.26
@@ -37,7 +37,7 @@
 </mm:cloud>
  * @author  Michiel Meeuwissen
  * @since   MMBase-1.8
- * @version $Id: Functions.java,v 1.25 2008/03/17 16:18:15 michiel Exp $
+ * @version $Id: Functions.java,v 1.26 2008/03/25 11:32:52 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