Skip to content

Commit

Permalink
Fix invoker being called on empty responsehandler
Browse files Browse the repository at this point in the history
  • Loading branch information
JetFault committed Sep 30, 2014
1 parent 44fec6c commit 22f5bd3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/angular-sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angular.module('ngSails').provider('$sails', function () {

return deferred;
},
resolveOrReject = $injector.invoke(this.responseHandler) || function (deferred, data, jwr) {
resolveOrReject = this.responseHandler ? $injector.invoke(this.responseHandler) : function (deferred, data, jwr) {
jwr.error = data.error;
// Make sure what is passed is an object that has a status that is a number and if that status is no 2xx, reject.
if (jwr && angular.isObject(jwr) && jwr.statusCode && !isNaN(jwr.statusCode) && Math.floor(jwr.statusCode / 100) !== 2) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-sails.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/service/angular-sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ angular.module('ngSails').provider('$sails', function () {

return deferred;
},
resolveOrReject = $injector.invoke(this.responseHandler) || function (deferred, data, jwr) {
resolveOrReject = this.responseHandler ? $injector.invoke(this.responseHandler) : function (deferred, data, jwr) {
jwr.error = data.error;
// Make sure what is passed is an object that has a status that is a number and if that status is no 2xx, reject.
if (jwr && angular.isObject(jwr) && jwr.statusCode && !isNaN(jwr.statusCode) && Math.floor(jwr.statusCode / 100) !== 2) {
Expand Down

0 comments on commit 22f5bd3

Please sign in to comment.