title: Error Cannot read property '0' of undefined
body: <p>I'm building a nodejs server for my mobile app and I've got a problem when I save data I can show it in my data.jade</p>
  
  <p>Here my error message :</p>
  
  <pre><code>Cannot read property '0' of undefined
      at jade_debug.unshift.lineno (eval at &lt;anonymous&gt; (/Users/****/Documents/Node-    server/node_modules/jade/lib/jade.js:160:8), &lt;anonymous&gt;:33:21)
  at eval (eval at &lt;anonymous&gt; (/Users/****/Documents/Node-server/node_modules/jade/lib/jade.js:160:8), &lt;anonymous&gt;:65:4)
  at res (/Users/****/Documents/Node-server/node_modules/jade/lib/jade.js:161:38)
  at Object.exports.render (/Users/****/Documents/Node-server/node_modules/jade/lib/jade.js:257:10)
  at Object.exports.renderFile (/Users/****/Documents/Node-server/node_modules/jade/lib/jade.js:293:18)
  at View.exports.renderFile [as engine] (/Users/Yanis/Documents/Node-server/node_modules/jade/lib/jade.js:278:21)
  at View.render (/Users/****/Documents/Node-server/node_modules/express/lib/view.js:76:8)
  at Function.app.render (/Users/****/Documents/Node-server/node_modules/express/lib/application.js:505:10)
  at ServerResponse.res.render (/Users/****/Documents/Node-server/node_modules/express/lib/response.js:756:7)
  at /Users/****/Documents/Node-server/index.js:44:9
  </code></pre>
  
  <p>index.js :</p>
  
  <pre><code>app.get('/:collection', function(req, res) {
      var params = req.params;
      collectionDriver.findAll(req.params.collection, function (error, objs) {
          if (error) {
              console.log("mongo db error"+error);
              objs = [];
          }
          else {
              if (req.accepts('html')) {
                  res.render('data', {objects: objs, collection: req.params.collection});
              }
              else {
                  res.set('Content-Type', 'application/json');
                  res.send(200, objs);
              }
         }
     });
  });
  </code></pre>
  
  <p>and finally my data.jade :</p>
  
  <pre><code>#objects
      table(border=1)
              if objects.length &gt; 0
                  - each val, key in object[0]
                      th= key
              - each obj in objects
                  tr.obj
                  - each val, key in obj
                      td.key= val
  </code></pre>
  
  <p>As you can see my object is not "define" in the data.jade and I don't know why. I don't know if the problem come from the jade file or de .js.
  Anyone of you have a solution?</p>