Fixed crash if non-text message is received while ChatFragment is open.
This commit is contained in:
parent
fb3592c2ae
commit
f040bb4032
1 changed files with 7 additions and 2 deletions
|
@ -111,8 +111,13 @@ class ChatFragment extends ListFragment with OnClickListener
|
||||||
* Displays new messages in UI.
|
* Displays new messages in UI.
|
||||||
*/
|
*/
|
||||||
override def onMessageReceived(msg: Message): Unit = {
|
override def onMessageReceived(msg: Message): Unit = {
|
||||||
if (Set(msg.Header.origin, msg.Header.target).contains(address))
|
if (!Set(msg.Header.origin, msg.Header.target).contains(address))
|
||||||
adapter.add(msg)
|
return
|
||||||
|
|
||||||
|
msg.Body match {
|
||||||
|
case _: Text => adapter.add(msg)
|
||||||
|
case _ =>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue