device: fix setting %NULL iface in nm_device_update_from_platform_link()

Fixes: f004e7b1a7 ('device: mark ifindex/iface fields of NMDevicePrivate as const')
This commit is contained in:
Thomas Haller 2020-07-20 16:11:25 +02:00
parent cb4fb0ac06
commit 6f29ed9f3f
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -4717,8 +4717,9 @@ nm_device_update_from_platform_link (NMDevice *self, const NMPlatformLink *plink
_notify (self, PROP_PATH);
}
str = plink ? plink->name : NULL;
if (nm_utils_strdup_reset (&priv->iface_, str))
if ( plink
&& !nm_str_is_empty (plink->name)
&& nm_utils_strdup_reset (&priv->iface_, plink->name))
_notify (self, PROP_IFACE);
str = plink ? plink->driver : NULL;