Ensure test does not fail.
This commit is contained in:
parent
1b0a4093d9
commit
5d4eaae933
1 changed files with 3 additions and 1 deletions
|
|
@ -242,8 +242,10 @@ class TimelineItemContentMessageFactory @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
@Suppress("USELESS_ELVIS")
|
||||
private fun String.withLinks(): CharSequence? {
|
||||
val spannable = toSpannable()
|
||||
/* Note: toSpannable() can return null when running unit tests */
|
||||
val spannable = toSpannable() ?: return null
|
||||
val addedLinks = LinkifyCompat.addLinks(spannable, Linkify.WEB_URLS or Linkify.PHONE_NUMBERS or Linkify.EMAIL_ADDRESSES)
|
||||
return spannable.takeIf { addedLinks }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue