Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-megh-l committed Jan 22, 2025
1 parent c79976f commit 6a79b75
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import timber.log.Timber
import java.util.Base64
import java.util.UUID

fun String.toBytes(): ByteArray? = try {
fun String.toBytes(): ByteArray = try {
Base64.getDecoder().decode(this)
} catch (e: Exception) {
Timber.e(e, "Failed to decode base64 string")
null
ByteArray(0)
}

fun ByteArray.encodeToString(): String = Base64.getEncoder().encodeToString(this)
Expand Down Expand Up @@ -99,9 +99,9 @@ fun LocationJourney.toEncryptedLocationJourney(
)
}

fun GroupCipher.decryptPoint(data: ByteArray?): Double? {
fun GroupCipher.decryptPoint(data: ByteArray): Double? {
return try {
data?.let { decrypt(it).toString(Charsets.UTF_8).toDoubleOrNull() }
decrypt(data).toString(Charsets.UTF_8).toDoubleOrNull()
} catch (e: Exception) {
Timber.e(e, "Failed to decrypt double")
null
Expand Down

0 comments on commit 6a79b75

Please sign in to comment.