l3cfg: gracefully accept %NULL argument in nm_l3_config_data_lookup_objs()

This way we can safely iterate over a %NULL instance with
nm_l3_config_data_iter_obj_for_each(). This avoids a NULL check,
which in this case seems more annoying than helpful.
This commit is contained in:
Thomas Haller 2020-09-08 18:25:02 +02:00
parent 6358d10688
commit d16776b5fd
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -583,6 +583,8 @@ nm_l3_config_data_lookup_index (const NML3ConfigData *self, NMPObjectType obj_ty
const NMDedupMultiHeadEntry *
nm_l3_config_data_lookup_objs (const NML3ConfigData *self, NMPObjectType obj_type)
{
if (!self)
return NULL;
return nm_dedup_multi_index_lookup_head (self->multi_idx,
nm_l3_config_data_lookup_index (self, obj_type),
NULL);