Skip to content

Commit

Permalink
Merge pull request #1849 from OneSignal/fix/concurrent_modification_e…
Browse files Browse the repository at this point in the history
…xception

Fix concurrent modification exception
  • Loading branch information
emawby committed Sep 25, 2023
2 parents bb041ad + 3402c6d commit a5c88de
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.onesignal.common.events.IEventNotifier
import org.json.JSONArray
import org.json.JSONObject
import java.math.BigDecimal
import java.util.*

/**
* The base class for a [Model]. A model is effectively a map of data, each key in the map being
Expand Down Expand Up @@ -61,7 +62,7 @@ open class Model(
get() = getStringProperty(::id.name)
set(value) { setStringProperty(::id.name, value) }

protected val data: MutableMap<String, Any?> = mutableMapOf()
protected val data: MutableMap<String, Any?> = Collections.synchronizedMap(mutableMapOf())
private val _changeNotifier = EventProducer<IModelChangedHandler>()

init {
Expand Down

0 comments on commit a5c88de

Please sign in to comment.