From e2c2eec41a29794dea0f65c9f1eb3f89b63cffd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 May 2018 03:06:13 -1100 Subject: [PATCH] Guard null it->second --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 119967a46..fa402338a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5147,7 +5147,8 @@ void static CheckBlockIndex() // Build forward-pointing map of the entire block tree. std::multimap forward; for (BlockMap::iterator it = mapBlockIndex.begin(); it != mapBlockIndex.end(); it++) { - forward.insert(std::make_pair(it->second->pprev, it->second)); + if ( it->second != 0 ) + forward.insert(std::make_pair(it->second->pprev, it->second)); } assert(forward.size() == mapBlockIndex.size());