From 95d88d6a82472dd70a0f4e15991b93764ce8a768 Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Sat, 6 Mar 2021 05:40:46 -0500 Subject: [PATCH] Fixed crash on startup when host address is empty (#6078) --- src/all/mango/build.gradle | 2 +- .../mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/all/mango/build.gradle b/src/all/mango/build.gradle index 4d3346927..4b5ce3295 100644 --- a/src/all/mango/build.gradle +++ b/src/all/mango/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Mango' pkgNameSuffix = 'all.mango' extClass = '.Mango' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } diff --git a/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt b/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt index db18db4c6..75cf52e32 100644 --- a/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt +++ b/src/all/mango/src/eu/kanade/tachiyomi/extension/all/mango/Mango.kt @@ -306,7 +306,7 @@ class Mango : ConfigurableSource, HttpSource() { // We strip the last slash since we will append it above private fun getPrefBaseUrl(): String { var path = preferences.getString(ADDRESS_TITLE, ADDRESS_DEFAULT)!! - if (path.last() == '/') { + if (path.isNotEmpty() && path.last() == '/') { path = path.substring(0, path.length - 1) } return path