From 3b276da357f99fe8ed7a1ce8fe3e3478d61f0521 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 1 Nov 2021 15:21:23 +0100 Subject: [PATCH] Fixed that candidateHost may is null --- .../jvmMain/kotlin/net/dankito/banking/util/BankIconFinder.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/BankingUiCommon/src/jvmMain/kotlin/net/dankito/banking/util/BankIconFinder.kt b/ui/BankingUiCommon/src/jvmMain/kotlin/net/dankito/banking/util/BankIconFinder.kt index 0ae56e76..48f2ed7f 100644 --- a/ui/BankingUiCommon/src/jvmMain/kotlin/net/dankito/banking/util/BankIconFinder.kt +++ b/ui/BankingUiCommon/src/jvmMain/kotlin/net/dankito/banking/util/BankIconFinder.kt @@ -214,7 +214,9 @@ open class BankIconFinder : IBankIconFinder { val candidateUri = URI.create(urlCandidate.replace("onlinebanking-", "")) val candidateHost = candidateUri.host - return bankNameParts.filter { part -> candidateHost.contains(part, true) }.size + if (candidateHost != null) { + return bankNameParts.filter { part -> candidateHost.contains(part, true) }.size + } } catch (e: Exception) { log.warn("Could not find host of url '$urlCandidate' in bank name $bankNameParts'", e) }