From c210b7720b46134a1d2539387fe3fcdf0b4082ab Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 13 Nov 2007 16:20:34 +0100 Subject: [PATCH] Do not fail if there is not an activity service --- NEWS | 1 + shell/view/Shell.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 340120b9..96eb0157 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* Do not fail if there is not an activity service. (marco) * Alert when an activity cannot be saved. (rwh) Snapshot 47e231311b diff --git a/shell/view/Shell.py b/shell/view/Shell.py index f6362306..05e058e1 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -171,11 +171,13 @@ class Shell(gobject.GObject): home_model = self._model.get_home() activity = home_model.get_active_activity() - if activity: - try: - activity.get_service().TakeScreenshot(timeout=2.0) - except dbus.DBusException, e: - logging.debug('Error raised by TakeScreenshot(): %s', e) + if activity is not None: + service = activity.get_service() + if service is not None: + try: + service.TakeScreenshot(timeout=2.0) + except dbus.DBusException, e: + logging.debug('Error raised by TakeScreenshot(): %s', e) def set_zoom_level(self, level): if level == self._zoom_level: