Skip to content

Commit

Permalink
fix exception while trying to access a SharedPreferences key with the…
Browse files Browse the repository at this point in the history
… format |T|<project_number>|*
  • Loading branch information
nbransby committed Feb 7, 2024
1 parent 34b5fcf commit 1c41357
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/main/java/android/content/Context.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ open class Context {
}

override fun getString(key: String, defaultValue: String?): String? {
when (key) {
"|T|app.teamhub.core|*" -> return null
"|T|dev.teamhub.core|*" -> return null
"last-used-date" -> return FirebasePlatform.firebasePlatform.retrieve(key) ?: defaultValue
else -> if(key.startsWith("com.google.firebase.auth.FIREBASE_USER")) {
return FirebasePlatform.firebasePlatform.retrieve(key) ?: defaultValue
}
return when {
key == "last-used-date" -> FirebasePlatform.firebasePlatform.retrieve(key) ?: defaultValue
key.startsWith("|T|") -> null
key.startsWith("com.google.firebase.auth.FIREBASE_USER") ->
FirebasePlatform.firebasePlatform.retrieve(key) ?: defaultValue
else -> throw IllegalArgumentException(key)
}
throw IllegalArgumentException(key)
}

override fun getLong(key: String?, defaultValue: Long): Long {
Expand Down

0 comments on commit 1c41357

Please sign in to comment.