[pitivi] viewer: Fix traceback when closing the project



commit 5ed4b7f636e3d04e6f5903bdd2f4af8356794a8e
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Apr 24 04:04:39 2018 +0200

    viewer: Fix traceback when closing the project
    
    It's difficult to reproduce since it happens when the project recovery
    fails and we gave up. Seems a good condition to add, since
    __get_pipeline_position gets to the pipeline through the app.
    
    Fixes #2129

 pitivi/viewer/move_scale_overlay.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/viewer/move_scale_overlay.py b/pitivi/viewer/move_scale_overlay.py
index 0c64c835..083df571 100644
--- a/pitivi/viewer/move_scale_overlay.py
+++ b/pitivi/viewer/move_scale_overlay.py
@@ -361,12 +361,15 @@ class MoveScaleOverlay(Overlay):
         return binding is not None
 
     def __get_pipeline_position(self):
-        pipeline = self.stack.app.project_manager.current_project.pipeline
-        try:
-            position = pipeline.getPosition()
-            return True, position
-        except PipelineError:
-            return False, None
+        project = self.stack.app.project_manager.current_project
+        if project:
+            pipeline = project.pipeline
+            try:
+                position = pipeline.getPosition()
+                return True, position
+            except PipelineError:
+                pass
+        return False, None
 
     def __get_source_position(self):
         res_x, x = self.__get_source_property("posx")


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