Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2966 from EOSIO/gh#2963-core
Browse files Browse the repository at this point in the history
Add null check with exception expected by net_plugin
  • Loading branch information
bytemaster committed May 11, 2018
2 parents bde431b + 18b3500 commit 6957747
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,12 @@ block_id_type controller::get_block_id_for_num( uint32_t block_num )const { try
return blk_state->id;
}

return my->blog.read_block_by_num(block_num)->id();
auto signed_blk = my->blog.read_block_by_num(block_num);

EOS_ASSERT( BOOST_LIKELY( signed_blk != nullptr ), unknown_block_exception,
"Could not find block: ${block}", ("block", block_num) );

return signed_blk->id();
} FC_CAPTURE_AND_RETHROW( (block_num) ) }

void controller::pop_block() {
Expand Down

0 comments on commit 6957747

Please sign in to comment.