File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
widgetssdk/src/main/java/com/glia/widgets/core/engagement Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ internal class GliaOperatorRepositoryImpl(private val gliaCore: GliaCore) : Glia
25
25
var isAlwaysUseDefaultOperatorPicture: Boolean = false
26
26
27
27
override fun getOperatorById (operatorId : String , callback : Consumer <LocalOperator ?>) {
28
- val cachedOperator = cachedOperators[operatorId]
28
+ val cachedOperator: LocalOperator ?
29
+ synchronized(cachedOperators) {
30
+ cachedOperator = cachedOperators[operatorId]
31
+ }
29
32
if (cachedOperator != null ) {
30
33
callback.accept(cachedOperator)
31
34
return
@@ -49,7 +52,9 @@ internal class GliaOperatorRepositoryImpl(private val gliaCore: GliaCore) : Glia
49
52
50
53
@VisibleForTesting
51
54
fun putOperator (operator : LocalOperator ) {
52
- operator .apply { cachedOperators.put(id, this ) }
55
+ synchronized(cachedOperators) {
56
+ operator .apply { cachedOperators.put(id, this ) }
57
+ }
53
58
}
54
59
55
60
override fun updateOperatorDefaultImageUrl (imageUrl : String? ) {
You can’t perform that action at this time.
0 commit comments