Check for existence of data.next before checking it

This commit is contained in:
mabashian 2020-07-22 13:47:19 -04:00
parent 6df173ce1d
commit 34e85dea8b

View File

@ -35,7 +35,7 @@ class Credentials extends Base {
},
}
);
if (data.next && requestCounter <= maxRequests) {
if (data?.next && requestCounter <= maxRequests) {
return fetchInputSources(
pageNo + 1,
inputSources.concat(data.results)