Skip to content

Commit 00d57ff

Browse files
committed
Avoid accessing nullpointer in BaseIndex::GetSummary()
1 parent 6abe9f5 commit 00d57ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index/base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,6 @@ IndexSummary BaseIndex::GetSummary() const
366366
IndexSummary summary{};
367367
summary.name = GetName();
368368
summary.synced = m_synced;
369-
summary.best_block_height = m_best_block_index.load()->nHeight;
369+
summary.best_block_height = m_best_block_index ? m_best_block_index.load()->nHeight : 0;
370370
return summary;
371371
}

0 commit comments

Comments
 (0)