From a0995a73a387467dd61f09e0dc6c38e09b575822 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Wed, 24 Apr 2019 23:11:24 +0200 Subject: [PATCH] Don't crash when incorrectly appending the port number to an rTorrent IP/hostname configuration. Fixes #480 --- .../java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java index fe294e49..274aacea 100644 --- a/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Rtorrent/RtorrentAdapter.java @@ -337,8 +337,11 @@ public class RtorrentAdapter implements IDaemonAdapter { } try { log.d(LOG_NAME, "Calling " + serverMethod + " with params [" + - (params.length() > 100 ? params.substring(0, 100) + "..." : params) + " ]"); + (params.length() > 100 ? params.substring(0, 100) + "..." : params) + " ]"); return rpcclient.call(serverMethod, arguments); + } catch (IllegalArgumentException e) { + log.d(LOG_NAME, "Using " + buildWebUIUrl() + ": " + e.toString()); + throw new DaemonException(ExceptionType.ConnectionError, "Error making call to " + serverMethod); } catch (XMLRPCException e) { log.d(LOG_NAME, e.toString()); if (e.getCause() instanceof UnauthorizdException) {