[pitivi] Don't error out when position can't be obtained



commit a662b6a8b0816f701dfdcee0af3a40b247a2a12f
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date:   Mon Apr 22 00:26:07 2013 +0200

    Don't error out when position can't be obtained

 pitivi/timeline/timeline.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ae31768..3ad8985 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -877,7 +877,10 @@ class Timeline(Gtk.VBox, Zoomable):
         if self.ruler.pressed or self.pressed:
             return
         canvas_size = self.embed.get_allocation().width - CONTROL_WIDTH
-        new_pos = Zoomable.nsToPixel(self.app.current.pipeline.getPosition())
+        try:
+            new_pos = Zoomable.nsToPixel(self.app.current.pipeline.getPosition())
+        except PipelineError:
+            return
         scroll_pos = self.hadj.get_value()
         self.scrollToPosition(min(new_pos - canvas_size / 2,
                                   self.hadj.props.upper - canvas_size - 1))


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