Handle nullable strings returned in contact mapper

This commit is contained in:
Moez Bhatti
2018-04-08 18:14:15 -04:00
parent 79f975971c
commit ae31905b46
@@ -39,9 +39,9 @@ class CursorToContactImpl @Inject constructor(private val context: Context) : Cu
override fun map(from: Cursor) = Contact().apply {
lookupKey = from.getString(COLUMN_LOOKUP_KEY)
name = from.getString(COLUMN_DISPLAY_NAME)
name = from.getString(COLUMN_DISPLAY_NAME) ?: ""
numbers.add(PhoneNumber().apply {
address = from.getString(COLUMN_NUMBER)
address = from.getString(COLUMN_NUMBER) ?: ""
type = context.getString(getTypeLabelResource(from.getInt(COLUMN_TYPE)))
})
lastUpdate = System.currentTimeMillis()