Skip to content

Commit 31525e0

Browse files
committed
Fix nullable operator image issue
After migration to Kotlin, the support for the operator picture being nullable was lost in one place. Because of that in case of the operator not having an image (as in acceptance tests) the chat state does not get updated on the engagement start
1 parent f13b50b commit 31525e0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

widgetssdk/src/main/java/com/glia/widgets/chat/controller/ChatController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ class ChatController(
623623
viewCallback?.minimizeView()
624624
}
625625

626-
private fun operatorConnected(operatorName: String, profileImgUrl: String) {
626+
private fun operatorConnected(operatorName: String, profileImgUrl: String?) {
627627
val items: MutableList<ChatItem> = chatState.chatItems.toMutableList()
628628
if (chatState.operatorStatusItem != null) {
629629
// remove previous operator status item
@@ -654,7 +654,7 @@ class ChatController(
654654
emitChatItems(chatState.changeItems(items))
655655
}
656656

657-
private fun operatorChanged(operatorName: String, profileImgUrl: String) {
657+
private fun operatorChanged(operatorName: String, profileImgUrl: String?) {
658658
val items: MutableList<ChatItem> = chatState.chatItems.toMutableList()
659659
val operatorStatusItem = OperatorStatusItem.OperatorJoinedStatusItem(
660660
chatState.companyName,

widgetssdk/src/main/java/com/glia/widgets/helper/Utils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.util.concurrent.TimeUnit;
4444

4545
public class Utils {
46+
@Nullable
4647
public static String getOperatorImageUrl(Operator operator) {
4748
return operator.getPicture() != null ? operator.getPicture().getURL().orElse(null) : null;
4849
}

0 commit comments

Comments
 (0)