From b6ae17aad17a2c6a61b1027ad7ba7c33fddf5006 Mon Sep 17 00:00:00 2001 From: Josh Cole Date: Thu, 13 Feb 2025 20:47:30 -0800 Subject: [PATCH] :bug: Fix a bug in RssFeed widget that crashes on small feeds. RssFeed would always default to this.limit for the size of the feed item array. Feeds that came in with fewer items than the limit would throw an exception, because the loop would then try to iterate over non-existent entries. --- src/components/Widgets/RssFeed.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Widgets/RssFeed.vue b/src/components/Widgets/RssFeed.vue index f958f603..4b56873b 100644 --- a/src/components/Widgets/RssFeed.vue +++ b/src/components/Widgets/RssFeed.vue @@ -131,7 +131,7 @@ export default { const posts = []; let { length } = items; if (this.limit) { - length = this.limit; + length = Math.min(length, this.limit); } for (let i = 0; length > i; i += 1) { posts.push({