Fix crash
This commit is contained in:
parent
f0a605091f
commit
dd1f6c796b
1 changed files with 1 additions and 5 deletions
|
@ -3,8 +3,6 @@ const path = require("path"),
|
|||
|
||||
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
|
||||
|
||||
var activityImages = constants.activityImages
|
||||
|
||||
function get_img_url(activity, size = "large_image") {
|
||||
if ("assets" in activity) {
|
||||
var image = activity.assets[size]
|
||||
|
@ -21,9 +19,7 @@ function get_img_url(activity, size = "large_image") {
|
|||
}
|
||||
|
||||
if (!image && size == "large_image") {
|
||||
if (activity.name in activityImages) {
|
||||
return decodeURIComponent(activityImages[activity.name])
|
||||
}
|
||||
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue