Add null check to deref
This commit is contained in:
@@ -403,7 +403,7 @@ namespace {
|
|||||||
|
|
||||||
if (!state->hashLastUnknownBlock.IsNull()) {
|
if (!state->hashLastUnknownBlock.IsNull()) {
|
||||||
BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock);
|
BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock);
|
||||||
if (itOld != mapBlockIndex.end() && itOld->second->chainPower > CChainPower())
|
if (itOld != mapBlockIndex.end() && itOld->second != 0 && (itOld->second->chainPower > CChainPower()))
|
||||||
{
|
{
|
||||||
if (state->pindexBestKnownBlock == NULL || itOld->second->chainPower >= state->pindexBestKnownBlock->chainPower)
|
if (state->pindexBestKnownBlock == NULL || itOld->second->chainPower >= state->pindexBestKnownBlock->chainPower)
|
||||||
state->pindexBestKnownBlock = itOld->second;
|
state->pindexBestKnownBlock = itOld->second;
|
||||||
|
|||||||
Reference in New Issue
Block a user