timeline-element: Properly handle setting name to NULL

This commit is contained in:
Thibault Saunier 2014-11-16 20:05:25 +01:00
parent 6367c96d7d
commit b7daa03a6e

View file

@ -1036,6 +1036,7 @@ ges_timeline_element_get_name (GESTimelineElement * self)
/** /**
* ges_timeline_element_set_name: * ges_timeline_element_set_name:
* @self: a #GESTimelineElement * @self: a #GESTimelineElement
* @name: (allow-none): The name @self should take (if avalaible<)
* *
* *
* Sets the name of object, or gives @self a guaranteed unique name (if name is NULL). * Sets the name of object, or gives @self a guaranteed unique name (if name is NULL).
@ -1055,7 +1056,7 @@ ges_timeline_element_set_name (GESTimelineElement * self, const gchar * name)
} }
/* parented objects cannot be renamed */ /* parented objects cannot be renamed */
if (self->timeline != NULL) { if (self->timeline != NULL && name) {
GESTimelineElement *tmp = ges_timeline_get_element (self->timeline, name); GESTimelineElement *tmp = ges_timeline_get_element (self->timeline, name);
if (tmp) { if (tmp) {