Permalink
Browse files

fixed calling `end` with no callback

  • Loading branch information...
1 parent 27f5e68 commit defe5cbf56e5717771d725f289ce6b8e56afb668 @rauchg rauchg committed Jul 31, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 superagent-queue.js
View
@@ -65,7 +65,11 @@ function extend(sa){
, fn = item[1]
// immutable .length hack :\
- if (fn.length == 1) {
+ if (!fn) {
+ oldEnd.call(obj, function(){
+ unqueue(name);
+ });
+ } else if (fn.length == 1) {
oldEnd.call(obj, function(res){
fn(res);
unqueue(name);

0 comments on commit defe5cb

Please sign in to comment.