Permalink
Browse files

Fixed a hanging response when there are no matches in the debug view

  • Loading branch information...
1 parent 7638150 commit a800823d6c3dbb94ed5f0465092ae8326fd85541 @jhurliman committed Feb 26, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 controllers/debug.js
  2. +1 −1 models/mysql.js
@@ -83,6 +83,8 @@ exports.debugQuery = function(req, res) {
renderView();
}
);
+ } else {
+ renderView();
}
function renderView() {
View
@@ -42,7 +42,7 @@ function fpQuery(fp, rows, callback) {
'LIMIT ' + rows;
client.query(sql, [], function(err, matches) {
if (err) return callback(err, null);
- if (!matches) return callback(null, []);
+ if (!matches || !matches.length) return callback(null, []);
var trackIDs = new Array(matches.length);
var trackIDMap = {};

0 comments on commit a800823

Please sign in to comment.