From ee1c477b1702b334748558ba91aa6c7ae1c4f558 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 6 Dec 2024 14:24:17 -0600 Subject: [PATCH] GH-1052 Verify root exists before accessing id() --- libraries/chain/fork_database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/fork_database.cpp b/libraries/chain/fork_database.cpp index f8f4fe39bc..fcb83bc20b 100644 --- a/libraries/chain/fork_database.cpp +++ b/libraries/chain/fork_database.cpp @@ -582,7 +582,7 @@ namespace eosio::chain { template BSP fork_database_impl::get_block_impl(const block_id_type& id, include_root_t include_root /* = include_root_t::no */) const { - if( include_root == include_root_t::yes && root->id() == id ) { + if( include_root == include_root_t::yes && root && root->id() == id ) { return root; } auto itr = index.find( id );