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

Commit

Permalink
Add null check with exception expected by net_plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed May 11, 2018
1 parent 849560d commit 18b3500
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 18b3500

Please sign in to comment.