[#1096] Fix null mined height crash
This handles the state in which is a transaction after it’s created with mined height null. It then doesn’t try to convert such a height into a BlockHeight object which is doing validation on input height. It rather returns null, similarly as for expiry height.
This commit is contained in:
parent
89ee0190af
commit
0a3efdbb6c
|
@ -86,11 +86,16 @@ internal class AllTransactionView(
|
|||
val isSent = netValueLong < 0
|
||||
|
||||
val expiryHeightLong = cursor.getLong(expiryHeightIndex)
|
||||
val minedHeightLong = cursor.getLong(minedHeightColumnIndex)
|
||||
|
||||
DbTransactionOverview(
|
||||
id = cursor.getLong(idColumnIndex),
|
||||
rawId = FirstClassByteArray(cursor.getBlob(rawTransactionIdIndex)),
|
||||
minedHeight = BlockHeight.new(zcashNetwork, cursor.getLong(minedHeightColumnIndex)),
|
||||
minedHeight = if (0L == minedHeightLong) {
|
||||
null
|
||||
} else {
|
||||
BlockHeight.new(zcashNetwork, minedHeightLong)
|
||||
},
|
||||
expiryHeight = if (0L == expiryHeightLong) {
|
||||
null
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue