[evince/gnome-2-30] [presentation] Fix a crash when starting animation



commit d6608cc1522c58f9612eb0b01cb852aa6f23e6a2
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Wed Jun 2 12:40:26 2010 +0200

    [presentation] Fix a crash when starting animation
    
    Fixes bug #619948.

 libview/ev-view-presentation.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index baa6bed..b1819ef 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -295,16 +295,16 @@ ev_view_presentation_animation_start (EvViewPresentation *pview,
 
 	pview->animation = ev_transition_animation_new (effect);
 
-	surface = EV_JOB_RENDER (pview->curr_job)->surface;
+	surface = pview->curr_job ? EV_JOB_RENDER (pview->curr_job)->surface : NULL;
 	ev_transition_animation_set_origin_surface (pview->animation,
 						    surface != NULL ?
 						    surface : pview->current_surface);
 
 	jump = new_page - pview->current_page;
 	if (jump == -1)
-		surface = EV_JOB_RENDER (pview->prev_job)->surface;
+		surface = pview->prev_job ? EV_JOB_RENDER (pview->prev_job)->surface : NULL;
 	else if (jump == 1)
-		surface = EV_JOB_RENDER (pview->next_job)->surface;
+		surface = pview->next_job ? EV_JOB_RENDER (pview->next_job)->surface : NULL;
 	else
 		surface = NULL;
 	if (surface)



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