mirror of
https://github.com/Qortal/qortal.git
synced 2025-06-06 00:07:00 +00:00
Fixed NPE caused by having an arbitrary transaction with no chunks (which is expected if the total data size is less than the chunk size).
This commit is contained in:
parent
16ac92b2ef
commit
95044d27ce
@ -394,6 +394,9 @@ public class ArbitraryDataFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean allChunksExist(byte[] chunks) {
|
public boolean allChunksExist(byte[] chunks) {
|
||||||
|
if (chunks == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ByteBuffer byteBuffer = ByteBuffer.wrap(chunks);
|
ByteBuffer byteBuffer = ByteBuffer.wrap(chunks);
|
||||||
while (byteBuffer.remaining() >= TransactionTransformer.SHA256_LENGTH) {
|
while (byteBuffer.remaining() >= TransactionTransformer.SHA256_LENGTH) {
|
||||||
byte[] chunkHash = new byte[TransactionTransformer.SHA256_LENGTH];
|
byte[] chunkHash = new byte[TransactionTransformer.SHA256_LENGTH];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user