Skip to content

Commit 89fa993

Browse files
committed
added nullables
1 parent e92e441 commit 89fa993

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

OGParser/src/main/java/com/kedia/ogparser/OpenGraphParser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class OpenGraphParser(
102102
return@withContext null
103103
}
104104

105-
if (openGraphResult!!.title.isEmpty() && openGraphResult!!.description.isEmpty() && showNullOnEmpty) {
105+
if (openGraphResult!!.title?.isEmpty() == true && openGraphResult!!.description?.isEmpty() == true && showNullOnEmpty) {
106106
launch(Dispatchers.Main) {
107107
listener.onError("Null or empty response from the server")
108108
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.kedia.ogparser
22

33
data class OpenGraphResult(
4-
var title: String = "",
5-
var description: String = "",
6-
var url: String = "",
7-
var image: String = "",
8-
var siteName: String = "",
9-
var type: String = ""
4+
var title: String? = null,
5+
var description: String? = null,
6+
var url: String? = null,
7+
var image: String? = null,
8+
var siteName: String? = null,
9+
var type: String? = null
1010
)

0 commit comments

Comments
 (0)