Return fallback image if remote fetch fails

This commit is contained in:
Minz committed 2023-08-02 23:16:20 +02:00
1 parent 1210d76381
commit 60fdbf9557
2 files changed
+1

No files matched your search

+1
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB