l3cfg: allow %NULL argument for nm_l3_config_data_ref()

It's often convenient not to require the caller to check for
%NULL. On the other hand, there are cases where having a %NULL instance
is a bug, so gracefully accepting %NULL might hide bugs.

Still, change it.
This commit is contained in:
Thomas Haller
2020-09-16 12:40:31 +02:00
parent 1b79b33206
commit 79913fb446

View File

@@ -434,8 +434,10 @@ nm_l3_config_data_new (NMDedupMultiIndex *multi_idx,
const NML3ConfigData *
nm_l3_config_data_ref (const NML3ConfigData *self)
{
nm_assert (_NM_IS_L3_CONFIG_DATA (self, TRUE));
((NML3ConfigData *) self)->ref_count++;
if (self) {
nm_assert (_NM_IS_L3_CONFIG_DATA (self, TRUE));
((NML3ConfigData *) self)->ref_count++;
}
return self;
}