From 78e588084f9063c8b955090287ad1c38183616e4 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 3 May 2020 15:50:51 +0200 Subject: [PATCH] import book: fix onFailure never called --- src/be/nikiroo/fanfix_swing/Actions.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/be/nikiroo/fanfix_swing/Actions.java b/src/be/nikiroo/fanfix_swing/Actions.java index a4b57708..849d3ace 100644 --- a/src/be/nikiroo/fanfix_swing/Actions.java +++ b/src/be/nikiroo/fanfix_swing/Actions.java @@ -251,11 +251,13 @@ public class Actions { try { Instance.getInstance().getLibrary().imprt(getUrl(url), pg); pg.done(); + if (onSuccess != null) { onSuccess.run(); } } catch (IOException e) { pg.done(); + if (e instanceof UnknownHostException) { UiHelper.error(parent, Instance.getInstance().getTransGui().getString( @@ -273,6 +275,10 @@ public class Actions { .getString(StringIdGui.TITLE_ERROR), e); } + + if (onFailure != null) { + onFailure.run(); + } } return null; -- 2.27.0