timeline-element: Properly handle setting name to NULL
authorThibault Saunier <tsaunier@gnome.org>
Sun, 16 Nov 2014 19:05:25 +0000 (20:05 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Sat, 6 Dec 2014 09:34:16 +0000 (10:34 +0100)
ges/ges-timeline-element.c

index 4d11446..3ace821 100644 (file)
@@ -1036,6 +1036,7 @@ ges_timeline_element_get_name (GESTimelineElement * self)
 /**
  * ges_timeline_element_set_name:
  * @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).
@@ -1055,7 +1056,7 @@ ges_timeline_element_set_name (GESTimelineElement * self, const gchar * name)
   }
 
   /* parented objects cannot be renamed */
-  if (self->timeline != NULL) {
+  if (self->timeline != NULL && name) {
     GESTimelineElement *tmp = ges_timeline_get_element (self->timeline, name);
 
     if (tmp) {