[F] Fix error case

This commit is contained in:
Hykilpikonna
2019-12-23 10:03:23 -05:00
parent 2295dc8b91
commit 4dfeaf28a4
+14 -2
View File
@@ -50,12 +50,24 @@
get imgThumb()
{
return require(`./assets/${this.rawDate}.pic.${this.format}`);
return this.getURL(`${this.rawDate}.pic.${this.format}`)
}
get imgFull()
{
return require(`./assets/${this.rawDate}.pic_hd.${this.format}`);
return this.getURL(`${this.rawDate}.pic_hd.${this.format}`);
}
getURL(img: string)
{
try
{
return require('./assets/' + img);
}
catch (e)
{
return './404.jpg'
}
}
}