mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 22:27:46 +00:00
epee: fix kv_unserialize return value when a field is not found
This commit is contained in:
parent
9fad4008ef
commit
fe5ab2c439
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ namespace epee
|
||||||
template<class serializible_type, class t_storage>
|
template<class serializible_type, class t_storage>
|
||||||
static bool unserialize_t_obj(serializible_type& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
|
static bool unserialize_t_obj(serializible_type& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
|
||||||
{
|
{
|
||||||
typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, true);
|
typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, false);
|
||||||
if(!hchild_section) return false;
|
if(!hchild_section) return false;
|
||||||
return obj._load(stg, hchild_section);
|
return obj._load(stg, hchild_section);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace epee
|
||||||
static bool unserialize_t_obj(enableable<serializible_type>& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
|
static bool unserialize_t_obj(enableable<serializible_type>& obj, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
|
||||||
{
|
{
|
||||||
obj.enabled = false;
|
obj.enabled = false;
|
||||||
typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, true);
|
typename t_storage::hsection hchild_section = stg.open_section(pname, hparent_section, false);
|
||||||
if(!hchild_section) return false;
|
if(!hchild_section) return false;
|
||||||
obj.enabled = true;
|
obj.enabled = true;
|
||||||
return obj.v._load(stg, hchild_section);
|
return obj.v._load(stg, hchild_section);
|
||||||
|
|
Loading…
Reference in a new issue