Skip to content

Commit b6ae17a

Browse files
committed
🐛 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.
1 parent 40b6699 commit b6ae17a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Widgets/RssFeed.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default {
131131
const posts = [];
132132
let { length } = items;
133133
if (this.limit) {
134-
length = this.limit;
134+
length = Math.min(length, this.limit);
135135
}
136136
for (let i = 0; length > i; i += 1) {
137137
posts.push({

0 commit comments

Comments
 (0)