We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4df6020 commit 34a9a7bCopy full SHA for 34a9a7b
src/api/instagram.ts
@@ -439,12 +439,16 @@ export class Instagram<PostType> {
439
this.responseFromAPI = true;
440
441
// Get JSON data
442
- let data: JSON;
+ let data: unknown;
443
try {
444
data = await res.json();
445
+ if (typeof data !== "object") {
446
+ throw new Error("Response data is not an object");
447
+ }
448
} catch (e) {
449
this.logger.error("Error processing response JSON");
450
this.logger.error(e);
451
+ continue;
452
}
453
454
// Emit event
0 commit comments