Skip to content

Commit

Permalink
ext.hpp: Accept null and empty array for extensions #593
Browse files Browse the repository at this point in the history
  • Loading branch information
theoreticalbts committed Feb 22, 2016
1 parent 2f941c7 commit 53699a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/chain/include/graphene/chain/protocol/ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ struct graphene_extension_from_variant_visitor
template< typename T >
void from_variant( const fc::variant& var, graphene::chain::extension<T>& value )
{
if( var.is_null() )
return;
if( var.is_array() )
{
FC_ASSERT( var.size() == 0 );
return;
}

graphene_extension_from_variant_visitor<T> vtor( var.get_object(), value.value );
fc::reflector<T>::visit( vtor );
FC_ASSERT( vtor.count_left == 0 ); // unrecognized extension throws here
Expand Down

0 comments on commit 53699a9

Please sign in to comment.