Skip to content

Commit

Permalink
Pull request #468: PZ-770 Null pointer fix
Browse files Browse the repository at this point in the history
Merge in MML/infobip-mobile-messaging-android from jdzubak-PZ-770-null-pointer-fix to master

Squashed commit of the following:

commit def9d7fcc47b4b4ba58c6c752b3e09395dbba1e0
Author: Jakub Dzubak <[email protected]>
Date:   Fri Nov 8 14:37:26 2024 +0100

    PZ-770 Null pointer fix
  • Loading branch information
jakubdzubak1 committed Nov 8, 2024
1 parent 61e4979 commit 67873f9
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ class InAppChatView @JvmOverloads constructor(
val message = if (CommonUtils.isJSON(error)) parseWidgetError(error) else error
Snackbar.make(binding.root, message, Snackbar.LENGTH_INDEFINITE)
.also {
val textView = it.view.findViewById<TextView>(androidx.core.R.id.text)
textView.maxLines = 4
runCatching {
var textView = it.view.findViewById<TextView>(androidx.core.R.id.text)
if (textView == null) {
textView = it.view.findViewById(com.google.android.material.R.id.snackbar_text)
}
if (textView != null) {
textView.maxLines = 4
}
}
}
.setAction(R.string.ib_chat_ok) {}
.show()
Expand Down

0 comments on commit 67873f9

Please sign in to comment.