pull/475/head
gedoor 4 years ago
parent 021ebb6416
commit 6e4323f247
  1. 10
      app/src/main/java/io/legado/app/help/JsExtensions.kt

@ -192,11 +192,17 @@ interface JsExtensions {
return str.htmlFormat() return str.htmlFormat()
} }
fun base64DecodeToByteArray(str: String): ByteArray { fun base64DecodeToByteArray(str: String?): ByteArray? {
if (str.isNullOrBlank()) {
return null
}
return Base64.decode(str, Base64.DEFAULT) return Base64.decode(str, Base64.DEFAULT)
} }
fun base64DecodeToByteArray(str: String, flags: Int): ByteArray { fun base64DecodeToByteArray(str: String?, flags: Int): ByteArray? {
if (str.isNullOrBlank()) {
return null
}
return Base64.decode(str, flags) return Base64.decode(str, flags)
} }

Loading…
Cancel
Save