mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Change length binary method
This commit is contained in:
@@ -36,9 +36,7 @@ class BinaryAttachment : Parcelable {
|
||||
private var dataFile: File? = null
|
||||
|
||||
fun length(): Long {
|
||||
if (dataFile != null)
|
||||
return dataFile!!.length()
|
||||
return 0
|
||||
return dataFile?.length() ?: 0
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +63,7 @@ class BinaryAttachment : Parcelable {
|
||||
@Throws(IOException::class)
|
||||
fun getInputDataStream(): InputStream {
|
||||
return when {
|
||||
dataFile != null -> FileInputStream(dataFile!!)
|
||||
length() > 0 -> FileInputStream(dataFile!!)
|
||||
else -> ByteArrayInputStream(ByteArray(0))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user