File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
android/src/main/java/com/formbricks/android/network Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,12 @@ import kotlinx.serialization.json.decodeFromJsonElement
1313import kotlinx.serialization.json.jsonObject
1414import retrofit2.Call
1515import retrofit2.Retrofit
16+ import java.util.concurrent.CopyOnWriteArrayList
1617
1718open class FormbricksApiService {
1819
1920 private var retrofit: Retrofit ? = null
20- private val callProvider = mutableListOf <Call <* >>()
21+ private val callProvider = CopyOnWriteArrayList <Call <* >>()
2122 fun initialize (appUrl : String , isLoggingEnabled : Boolean ) {
2223 val builder = FormbricksRetrofitBuilder (appUrl, isLoggingEnabled).getBuilder()
2324 if (builder != null ) {
@@ -80,7 +81,11 @@ open class FormbricksApiService {
8081 }
8182
8283 fun cancelCallApi () {
83- callProvider.map { it.cancel() }
84- callProvider.clear()
84+ try {
85+ callProvider.map { it.cancel() }
86+ callProvider.clear()
87+ } catch (e: Exception ) {
88+ Logger .d(e.message ? : " " )
89+ }
8590 }
8691}
You can’t perform that action at this time.
0 commit comments