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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user