Return fallback image if remote fetch fails

This commit is contained in:
2023-08-02 23:16:20 +02:00
parent 1210d76381
commit 60fdbf9557
2 changed files with 1 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ func GetRemoteImage(url):
error = image.load_jpg_from_buffer(res[3]) error = image.load_jpg_from_buffer(res[3])
if error != OK: if error != OK:
print("Error fetching image ", str(error)) print("Error fetching image ", str(error))
image.load("res://assets/fallback_card.png")
image.save_png(outFile) image.save_png(outFile)
print("Saved new image to cache. " + outFile) print("Saved new image to cache. " + outFile)
return image return image

BIN
assets/fallback_card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB