[pitivi] timeline: Restore the selection only if all the clips have been found



commit c863fe7689179b49eb659404ca3913a7937287e5
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Wed Sep 9 22:34:30 2020 +0200

    timeline: Restore the selection only if all the clips have been found
    
    Currently passing None elements to set_selection raises an exception.
    
    Fixes #2480

 pitivi/timeline/timeline.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 8621056f7..f91883f0b 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1579,7 +1579,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
             if clip_names:
                 clips = [self.ges_timeline.get_element(clip_name)
                          for clip_name in clip_names]
-                self.timeline.selection.set_selection(clips, SELECT)
+                if all(clips):
+                    self.timeline.selection.set_selection(clips, SELECT)
 
             zoom_level = self.editor_state.get_value("zoom-level")
             if zoom_level:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]