Return fallback image if remote fetch fails
This commit is contained in:
2 files changed
+1
No files matched your search
@@ -30,6 +30,7 @@ func GetRemoteImage(url):
|
||||
error = image.load_jpg_from_buffer(res[3])
|
||||
if error != OK:
|
||||
print("Error fetching image ", str(error))
|
||||
image.load("res://assets/fallback_card.png")
|
||||
image.save_png(outFile)
|
||||
print("Saved new image to cache. " + outFile)
|
||||
return image
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 204 KiB |
Reference in new issue
Block a user