mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
improve exception handling when loading paynym avatars
This commit is contained in:
parent
484ef5f399
commit
d49d5967b2
1 changed files with 3 additions and 0 deletions
|
@ -126,6 +126,9 @@ public class PayNymAvatar extends StackPane {
|
||||||
|
|
||||||
try(InputStream is = (proxy == null ? new URI(url).toURL().openStream() : new URI(url).toURL().openConnection(proxy).getInputStream())) {
|
try(InputStream is = (proxy == null ? new URI(url).toURL().openStream() : new URI(url).toURL().openConnection(proxy).getInputStream())) {
|
||||||
Image image = new Image(is, 150, 150, true, true);
|
Image image = new Image(is, 150, 150, true, true);
|
||||||
|
if(image.getException() != null) {
|
||||||
|
throw image.getException();
|
||||||
|
}
|
||||||
paymentCodeCache.put(cacheId, image);
|
paymentCodeCache.put(cacheId, image);
|
||||||
Platform.runLater(() -> EventManager.get().post(new PayNymImageLoadedEvent(paymentCode, image)));
|
Platform.runLater(() -> EventManager.get().post(new PayNymImageLoadedEvent(paymentCode, image)));
|
||||||
return image;
|
return image;
|
||||||
|
|
Loading…
Reference in a new issue