r9770 - helma-ng/trunk/modules/helma

[email protected] Thu, 14 May 2009 21:05:16 +0200 (CEST)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090514190516.28D963D0D6@mia>
Author: hannes
Date: 2009-05-14 21:05:16 +0200 (Thu, 14 May 2009)
New Revision: 9770

Modified:
   helma-ng/trunk/modules/helma/webapp.js
Log:
Don't crash on non-existing middleware config

Details at http://dev.helma.org/trac/helma/changeset/9770

Modified: helma-ng/trunk/modules/helma/webapp.js
===================================================================
--- helma-ng/trunk/modules/helma/webapp.js	2009-05-14 18:47:31 UTC (rev 9769)
+++ helma-ng/trunk/modules/helma/webapp.js	2009-05-14 19:05:16 UTC (rev 9770)
@@ -110,7 +110,8 @@
                         var middlewareIndex = 0;
                         // set up middleware chain in request object
                         req.process = function() {
-                            if (middlewareIndex < middleware.length) {
+                            if (middleware instanceof Array
+                                    && middlewareIndex < middleware.length) {
                                 return invokeMiddleware(middleware[middlewareIndex++], [req]);
                             } else {
                                 return action.apply(module, args);