From d49d5967b282856bd1b6b06a88892dcb411455a9 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 25 Nov 2024 10:30:28 +0200 Subject: [PATCH] improve exception handling when loading paynym avatars --- .../java/com/sparrowwallet/sparrow/control/PayNymAvatar.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/PayNymAvatar.java b/src/main/java/com/sparrowwallet/sparrow/control/PayNymAvatar.java index 66ac32b6..8b61b719 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/PayNymAvatar.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/PayNymAvatar.java @@ -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())) { Image image = new Image(is, 150, 150, true, true); + if(image.getException() != null) { + throw image.getException(); + } paymentCodeCache.put(cacheId, image); Platform.runLater(() -> EventManager.get().post(new PayNymImageLoadedEvent(paymentCode, image))); return image;