From dc8abd0032b712320a66305ffc1e8429f491038a Mon Sep 17 00:00:00 2001 From: AsamK Date: Tue, 9 Nov 2021 22:46:32 +0100 Subject: [PATCH] Close Manager if checkAccountState fails --- src/main/java/org/asamk/signal/App.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/asamk/signal/App.java b/src/main/java/org/asamk/signal/App.java index 7375a5c3..03bb6fcb 100644 --- a/src/main/java/org/asamk/signal/App.java +++ b/src/main/java/org/asamk/signal/App.java @@ -315,6 +315,11 @@ public class App { try { manager.checkAccountState(); } catch (IOException e) { + try { + manager.close(); + } catch (IOException ie) { + logger.warn("Failed to close broken account", ie); + } throw new IOErrorException("Error while checking account " + username + ": " + e.getMessage(), e); }