Skip to content
Snippets Groups Projects
Commit 73dc3a9b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

various null checks

Change-Id: I733513a87b81577971fdbdef18ee118124a8fdc8
parent 941b1fe2
No related branches found
No related tags found
No related merge requests found
......@@ -332,7 +332,7 @@ class ConversationAdapter(
// Remove user from statusMap.
val modifiedStatusMap = interaction.statusMap
.filter { !conversation.findContact(net.jami.model.Uri.fromId(it.key))!!.isUser }
.filter { conversation.findContact(net.jami.model.Uri.fromId(it.key))?.isUser != true }
val isDisplayed = modifiedStatusMap.any { it.value == Interaction.MessageStates.DISPLAYED }
val isReceived = modifiedStatusMap.any { it.value == Interaction.MessageStates.SUCCESS }
......
......@@ -149,9 +149,12 @@ class ConversationMediaGalleryAdapter(
val videoRatio = mediaPlayer.videoWidth / mediaPlayer.videoHeight.toFloat()
val screenRatio = video.video.width / video.video.height.toFloat()
val scaleX = videoRatio / screenRatio
if (scaleX >= 1f) {
if (scaleX.isNaN() || scaleX.isInfinite() || scaleX <= 0f) {
video.video.scaleX = 1f
video.video.scaleY = 1f
} else if (scaleX >= 1f) {
video.video.scaleX = scaleX
} else if (scaleX != 0f){
} else {
video.video.scaleY = 1f / scaleX
}
}
......
......@@ -750,7 +750,7 @@ abstract class CallService(
}
fun hangUpAny(accountId: String, callId: String) {
calls.filterValues { it.daemonIdString == callId }.firstNotNullOf {
calls.filterValues { it.daemonIdString == callId }.forEach {
val confId = it.value.confId
if(confId != null)
hangUpConference(accountId, confId)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment