l3cfg: accept %NULL argument to nm_l3_config_data_seal()

There is always a question between convenience of allowing %NULL (and
do nothing) and strictly require the user to check the argument to not
be %NULL. In this case, it's more convenient to accept NULL, than require
the callers to check for it.
This commit is contained in:
Thomas Haller 2021-09-16 16:22:19 +02:00
parent 6f2c69f484
commit 882168c728
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -700,8 +700,10 @@ nm_l3_config_data_ref_and_seal(const NML3ConfigData *self)
const NML3ConfigData *
nm_l3_config_data_seal(const NML3ConfigData *self)
{
nm_assert(_NM_IS_L3_CONFIG_DATA(self, TRUE));
((NML3ConfigData *) self)->is_sealed = TRUE;
if (self) {
nm_assert(_NM_IS_L3_CONFIG_DATA(self, TRUE));
((NML3ConfigData *) self)->is_sealed = TRUE;
}
return self;
}