Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/main/java/org/tron/core/db/BlockIndexStore.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.tron.core.db;

import java.util.Arrays;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.tron.common.utils.ByteArray;
Expand All @@ -11,8 +11,6 @@
import org.tron.core.capsule.BytesCapsule;
import org.tron.core.exception.ItemNotFoundException;

import java.util.Arrays;

@Component
public class BlockIndexStore extends TronStoreWithRevoking<BytesCapsule> {

Expand All @@ -30,7 +28,7 @@ public void put(BlockId id) {
public BlockId get(Long num)
throws ItemNotFoundException {
BytesCapsule value = getUnchecked(ByteArray.fromLong(num));
if(value == null) {
if (value == null || value.getData() == null) {
throw new ItemNotFoundException("number: " + num + " is not found!");
}
return new BlockId(Sha256Hash.wrap(value.getData()), num);
Expand Down