clutter/actor: Handle _clutter_actor_get_debug_name(NULL)

NULL actor pointers seem to arise sometimes in `clutter_stage_update_device`
when using a touchscreen, but that's only fatal with `CLUTTER_DEBUG=event`.
So just handle NULL where it was crashing: `_clutter_actor_get_debug_name`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3413>
This commit is contained in:
Daniel van Vugt 2023-11-21 17:26:15 +08:00 committed by Marge Bot
parent 9ddb0371c6
commit f74fe6bd67

View File

@ -998,9 +998,14 @@ G_DEFINE_TYPE_WITH_CODE (ClutterActor,
const char *
_clutter_actor_get_debug_name (ClutterActor *actor)
{
ClutterActorPrivate *priv = actor->priv;
ClutterActorPrivate *priv;
const char *retval;
if (!actor)
return "<unnamed>[<ClutterActor>NULL]";
priv = actor->priv;
if (G_UNLIKELY (priv->debug_name == NULL))
{
priv->debug_name = g_strdup_printf ("<%s>[<%s>:%p]",