Skip to content

Commit 4e24b08

Browse files
author
Manas George
committed
Skipping past stories with undefined url and title
1 parent 0f22c72 commit 4e24b08

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/provider/.pocket.ts.swp

4 KB
Binary file not shown.

src/provider/pocket.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ export default class PocketProvider {
239239
};
240240
const stories = await this.getStories(combinedSearchParams);
241241
for (const story of stories) {
242+
if (story.url === undefined || story.title === undefined) {
243+
console.warn("WARN: Skipping story due to undefined url or title:", story);
244+
continue; // Skip this iteration
245+
}
242246
feed.addArticleAcquisitionEntry(story.url, story.title);
243247
}
244248
res.type('application/xml').send(feed.toXmlString());
@@ -267,6 +271,10 @@ export default class PocketProvider {
267271
};
268272
const stories = await this.getStories(combinedSearchParams);
269273
for (const story of stories) {
274+
if (story.url === undefined || story.title === undefined) {
275+
console.warn("WARN: Skipping story due to undefined url or title:", story);
276+
continue; // Skip this iteration
277+
}
270278
feed.addArticleAcquisitionEntry(story.url, story.title);
271279
}
272280
res.type('application/xml').send(feed.toXmlString());
@@ -322,4 +330,4 @@ export default class PocketProvider {
322330
// Persist the access token into the config dir
323331
fs.writeFileSync(this.authConfigPath, token);
324332
}
325-
}
333+
}

0 commit comments

Comments
 (0)