forked from Louvorg/ReaderForSelfoss-multiplatform
fix: url can be empty ?
This commit is contained in:
@ -127,8 +127,8 @@ class SelfossModel {
|
||||
val tags: List<String>,
|
||||
val author: String? = null,
|
||||
) {
|
||||
fun getLinkDecoded(): String {
|
||||
var stringUrl: String
|
||||
fun getLinkDecoded(): String? {
|
||||
var stringUrl: String?
|
||||
stringUrl =
|
||||
if (link.contains("//news.google.com/news/") && link.contains("&url=")) {
|
||||
link.substringAfter("&url=")
|
||||
@ -146,11 +146,7 @@ class SelfossModel {
|
||||
stringUrl = "http:$stringUrl"
|
||||
}
|
||||
|
||||
if (stringUrl.isEmptyOrNullOrNullString()) {
|
||||
throw ModelException("Link $link was translated to $stringUrl, but was empty. Handle this.")
|
||||
}
|
||||
|
||||
return stringUrl
|
||||
return if (stringUrl.isEmptyOrNullOrNullString()) null else stringUrl
|
||||
}
|
||||
|
||||
fun sourceAuthorAndDate(): String {
|
||||
|
Reference in New Issue
Block a user