diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt index 3af1a22779..e7274db901 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt @@ -17,9 +17,11 @@ package org.matrix.android.sdk.api import org.matrix.android.sdk.BuildConfig +import timber.log.Timber /** * This class contains pattern to match the different Matrix ids + * Ref: https://matrix.org/docs/spec/appendices#identifier-grammar */ object MatrixPatterns { @@ -173,8 +175,9 @@ object MatrixPatterns { * - "@bob:domain.org:3455".getDomain() will return "domain.org:3455" */ fun String.getDomain(): String { - if (BuildConfig.DEBUG) { - assert(isUserId(this)) + if (BuildConfig.DEBUG && !isUserId(this)) { + // They are some invalid userId localpart in the wild, but the domain part should be there anyway + Timber.w("Not a valid user ID: $this") } return substringAfter(":") }