Skip to content

Commit ebad1a6

Browse files
committed
fix(build): prevent Type mismatch: inferred type is String? but String was expected on build
Signed-off-by: stonebuzz <skita@teclib.com>
1 parent 5d28aee commit ebad1a6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

example_kotlin/src/main/java/org/flyve/example_kotlin/MainActivity.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,20 @@ class MainActivity : AppCompatActivity() {
112112
}
113113

114114
override fun onTaskError(error: Throwable) {
115-
Log.e(LOG, error.message)
115+
error.message?.let { Log.e(LOG, it) }
116116
}
117117
})
118118
inventoryTask.getJSON(object : InventoryTask.OnTaskCompleted {
119119
override fun onTaskSuccess(data: String?) {
120-
Log.d(LOG, data)
120+
if (data != null) {
121+
Log.d(LOG, data)
122+
}
121123
//show btn share
122124
btnShare.visibility = View.VISIBLE
123125
}
124126

125127
override fun onTaskError(error: Throwable?) {
126-
Log.e(LOG, error?.message)
128+
error?.message?.let { Log.e(LOG, it) }
127129
}
128130

129131
})

0 commit comments

Comments
 (0)