Fixed crash on startup when host address is empty (#6078)
This commit is contained in:
parent
88bd826168
commit
95d88d6a82
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'Mango'
|
extName = 'Mango'
|
||||||
pkgNameSuffix = 'all.mango'
|
pkgNameSuffix = 'all.mango'
|
||||||
extClass = '.Mango'
|
extClass = '.Mango'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ class Mango : ConfigurableSource, HttpSource() {
|
||||||
// We strip the last slash since we will append it above
|
// We strip the last slash since we will append it above
|
||||||
private fun getPrefBaseUrl(): String {
|
private fun getPrefBaseUrl(): String {
|
||||||
var path = preferences.getString(ADDRESS_TITLE, ADDRESS_DEFAULT)!!
|
var path = preferences.getString(ADDRESS_TITLE, ADDRESS_DEFAULT)!!
|
||||||
if (path.last() == '/') {
|
if (path.isNotEmpty() && path.last() == '/') {
|
||||||
path = path.substring(0, path.length - 1)
|
path = path.substring(0, path.length - 1)
|
||||||
}
|
}
|
||||||
return path
|
return path
|
||||||
|
|
Loading…
Reference in New Issue