Permalink
Browse files

Merge pull request #137 from flatiron/fix_rows_error

[fix] fix uncaught error when a view does not return `rows`.
  • Loading branch information...
2 parents 7f387ee + 8ebd01f commit de93f1e36245752bacade91d0806c50d54b5ed6e @mmalecki mmalecki committed Mar 7, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/resourceful/engines/couchdb/index.js
@@ -172,7 +172,7 @@ Couchdb.prototype.view = function (path, opts, callback) {
return this.request.call(this, 'view', path, opts, function (e, res) {
if (e) return callback(e);
- callback(null, res.rows.map(function (r) {
+ callback(null, (res.rows || []).map(function (r) {
// With `include_docs=true`, the 'doc' attribute is set instead of 'value'.
if (r.doc) {
if (r.doc._id) {

0 comments on commit de93f1e

Please sign in to comment.