Skip to content

Commit

Permalink
added nullables
Browse files Browse the repository at this point in the history
  • Loading branch information
pknotfound committed Aug 24, 2021
1 parent e92e441 commit 89fa993
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class OpenGraphParser(
return@withContext null
}

if (openGraphResult!!.title.isEmpty() && openGraphResult!!.description.isEmpty() && showNullOnEmpty) {
if (openGraphResult!!.title?.isEmpty() == true && openGraphResult!!.description?.isEmpty() == true && showNullOnEmpty) {
launch(Dispatchers.Main) {
listener.onError("Null or empty response from the server")
}
Expand Down
12 changes: 6 additions & 6 deletions OGParser/src/main/java/com/kedia/ogparser/OpenGraphResult.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.kedia.ogparser

data class OpenGraphResult(
var title: String = "",
var description: String = "",
var url: String = "",
var image: String = "",
var siteName: String = "",
var type: String = ""
var title: String? = null,
var description: String? = null,
var url: String? = null,
var image: String? = null,
var siteName: String? = null,
var type: String? = null
)

0 comments on commit 89fa993

Please sign in to comment.