TP-29164 | Pulse buildEvent Crash fix (#7283)
This commit is contained in:
@@ -20,11 +20,17 @@ object PulseUtils {
|
||||
|
||||
@WorkerThread
|
||||
fun buildEvent(eventName: String, properties: Map<String, String>? = null): PulseEvent {
|
||||
val propertiesConcurrentHashMap: ConcurrentHashMap<String, String> =
|
||||
if (properties == null) ConcurrentHashMap() else ConcurrentHashMap(properties)
|
||||
val propertiesConcurrentHashMap: ConcurrentHashMap<String, String> = ConcurrentHashMap()
|
||||
properties?.let {
|
||||
val iterator = it.entries.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val (key, value) = iterator.next()
|
||||
propertiesConcurrentHashMap[key] = value
|
||||
}
|
||||
}
|
||||
val timeStamp = System.currentTimeMillis()
|
||||
PulseSDKConfig.getSessionId()?.let {
|
||||
propertiesConcurrentHashMap.put(SESSION_ID, it)
|
||||
PulseSDKConfig.getSessionId()?.let { sessionId ->
|
||||
propertiesConcurrentHashMap[SESSION_ID] = sessionId
|
||||
}
|
||||
val eventData = EventData(eventName, timeStamp, propertiesConcurrentHashMap)
|
||||
PulseLogger.log(LOG_TAG, "Event object created - $eventName")
|
||||
|
||||
Reference in New Issue
Block a user