mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-03-05 13:30:33 -05:00
fix an issue where post has images but resolutions array is undefined
This commit is contained in:
@@ -45,8 +45,10 @@ module.exports = function() {
|
||||
thumb: await downloadAndSave(data.thumbnail, 'thumb_')
|
||||
}
|
||||
} else {
|
||||
images = {
|
||||
thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_')
|
||||
if(data.preview.images[0].resolutions[0]) {
|
||||
images = {
|
||||
thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user