log-object: don't construct log ID with NULL self_id
If the object has an owner ID already but doesn't yet have enough information to build its log ID, don't cache a less-than-useful log ID string for it. Signed-off-by: Dan Williams <dan@ioncontrol.co>
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ mm_log_object_get_id (MMLogObject *self)
|
||||
gchar *self_id;
|
||||
|
||||
self_id = MM_LOG_OBJECT_GET_IFACE (self)->build_id (self);
|
||||
if (priv->owner_id) {
|
||||
if (self_id && priv->owner_id) {
|
||||
priv->id = g_strdup_printf ("%s/%s", priv->owner_id, self_id);
|
||||
g_free (self_id);
|
||||
} else
|
||||
|
||||
@@ -132,6 +132,9 @@ log_object_build_id (MMLogObject *_self)
|
||||
MMPort *self;
|
||||
|
||||
self = MM_PORT (_self);
|
||||
if (!self->priv->device || !self->priv->ptype)
|
||||
return NULL;
|
||||
|
||||
return g_strdup_printf ("%s/%s",
|
||||
mm_port_get_device (self),
|
||||
mm_port_type_get_string (mm_port_get_port_type (self)));
|
||||
|
||||
Reference in New Issue
Block a user