Skip to content

Commit da3d055

Browse files
committed
getList throwing error after interceptor
Fixes #544
1 parent 5f19355 commit da3d055

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/restangular.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,11 @@ module.provider('Restangular', function() {
10481048
urlHandler.resource(this, $http, request.httpConfig, request.headers, request.params, what,
10491049
this[config.restangularFields.etag], operation)[method]().then(function(response) {
10501050
var resData = response.data;
1051-
if (!_.isArray(resData)) {
1052-
throw new Error("Response for getList SHOULD be an array and not an object or something else");
1053-
}
10541051
var fullParams = response.config.params;
10551052
var data = parseResponse(resData, operation, whatFetched, url, response, deferred);
1053+
if (!_.isArray(data)) {
1054+
throw new Error("Response for getList SHOULD be an array and not an object or something else");
1055+
}
10561056
var processedData = _.map(data, function(elem) {
10571057
if (!__this[config.restangularFields.restangularCollection]) {
10581058
return restangularizeElem(__this, elem, what, true, data);

0 commit comments

Comments
 (0)