Skip to content

Commit 5fc3c7f

Browse files
borrrdenclaude
andauthored
Fix nullability mismatch in deprecated newConfig extension (#122)
getCollectionConfigs() was tightened to take a non-null BaseReplicatorConfiguration (CBL-7303), but the re-added 3.x deprecated ReplicatorConfiguration?.newConfig extension still passes its nullable receiver, breaking compilation. Guard the call with this?.let { getCollectionConfigs(it) }. This matches the 3.3 behavior: the ReplicatorConfiguration constructor treats a null collection map as empty, so a null receiver yields an empty configuration exactly as before. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a86deb8 commit 5fc3c7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/main/kotlin/com/couchbase/lite/ConfigurationFactories.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fun ReplicatorConfiguration?.newConfig(
100100
val endPt =
101101
target ?: this?.target ?: throw IllegalArgumentException("A ReplicatorConfiguration must specify an endpoint")
102102
val config = if (collections == null) {
103-
ReplicatorConfiguration(endPt, getCollectionConfigs(this))
103+
ReplicatorConfiguration(endPt, this?.let { getCollectionConfigs(it) })
104104
} else {
105105
val rc = ReplicatorConfiguration(endPt)
106106
// Lint will flip out if you try to use `forEach` here.

0 commit comments

Comments
 (0)