mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-09 12:52:32 +01:00
fix an issue where post has images but resolutions array is undefined
This commit is contained in:
parent
9665f36681
commit
e4e5136b37
@ -45,11 +45,13 @@ module.exports = function() {
|
||||
thumb: await downloadAndSave(data.thumbnail, 'thumb_')
|
||||
}
|
||||
} else {
|
||||
if(data.preview.images[0].resolutions[0]) {
|
||||
images = {
|
||||
thumb: await downloadAndSave(data.preview.images[0].resolutions[0].url, 'thumb_')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
author: data.author,
|
||||
created: data.created_utc,
|
||||
|
Loading…
Reference in New Issue
Block a user