Skip to content

Commit a292240

Browse files
Update Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt
Co-authored-by: matter-code-review[bot] <150888575+matter-code-review[bot]@users.noreply.github.com>
1 parent d22c403 commit a292240

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Branch-SDK/src/main/java/io/branch/referral/BranchConfigurationController.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,22 @@ class BranchConfigurationController {
121121
fun serializeConfiguration(): JSONObject {
122122
return try {
123123
JSONObject().apply {
124-
put("expectDelayedSessionInitialization", getDelayedSessionInitUsed())
125-
put("testMode", isTestModeEnabled())
126-
put("trackingDisabled", isTrackingDisabled())
127-
put("instantDeepLinkingEnabled", isInstantDeepLinkingEnabled())
128-
put("deferInitForPluginRuntime", isDeferInitForPluginRuntime())
124+
put(\"expectDelayedSessionInitialization\", getDelayedSessionInitUsed())
125+
put(\"testMode\", isTestModeEnabled())
126+
put(\"trackingDisabled\", isTrackingDisabled())
127+
put(\"instantDeepLinkingEnabled\", isInstantDeepLinkingEnabled())
128+
put(\"deferInitForPluginRuntime\", isDeferInitForPluginRuntime())
129129
}
130+
} catch (e: NullPointerException) {
131+
BranchLogger.w(\"Error serializing configuration - null reference: ${e.message}\")
132+
JSONObject()
133+
} catch (e: JSONException) {
134+
BranchLogger.w(\"Error serializing configuration - JSON error: ${e.message}\")
135+
JSONObject()
130136
} catch (e: Exception) {
131-
BranchLogger.w("Error serializing configuration: ${e.message}")
137+
BranchLogger.w(\"Error serializing configuration - unexpected error: ${e.message}\")
132138
JSONObject()
133139
}
134140
}
141+
}
135142
}

0 commit comments

Comments
 (0)