Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit de93f1e36245752bacade91d0806c50d54b5ed6e 2 parents 7f387ee + 8ebd01f
@mmalecki mmalecki authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/resourceful/engines/couchdb/index.js
View
2  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) {
Please sign in to comment.
Something went wrong with that request. Please try again.