Skip to content

Commit

Permalink
Merge pull request deltaepsilon#9 from chiukit/master
Browse files Browse the repository at this point in the history
fixed empty or null response for finite pagination
  • Loading branch information
deltaepsilon authored May 8, 2017
2 parents 3c0f1a0 + ab49feb commit 1748054
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion firebase-paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ function FirebasePaginator(ref, defaults) {
if (request.readyState === 4) {
var response = JSON.parse(request.responseText);
if (request.status === 200) {
resolve(Object.keys(response));
if (response){
resolve(Object.keys(response));
} else {
resolve([]);
}
} else {
reject(response);
}
Expand Down

0 comments on commit 1748054

Please sign in to comment.