From c048c1872a020a07b07139fa3bfe370adbb1ebcc Mon Sep 17 00:00:00 2001 From: Michael Stone Date: Fri, 21 Jan 2011 20:23:53 +0000 Subject: Avoid popping an empty list in the software updater. When you run Sugar with no activities installed, UpdateModel._bundles_to_check is empty. Attempting to unconditionally pop this list results in an IndexError. Instead, the updater should stop trying to update bundles when it determines that it has no more bundles to check. Signed-off-by: Michael Stone [style fix] Signed-off-by: Sascha Silbe Reviewed-by: Sascha Silbe Reviewed-by: Aleksey Lim --- diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py index 57d6ace..7ea445f 100755 --- a/extensions/cpsection/updater/model.py +++ b/extensions/cpsection/updater/model.py @@ -72,6 +72,9 @@ class UpdateModel(gobject.GObject): total = len(bundleregistry.get_registry()) current = total - len(self._bundles_to_check) + if not self._bundles_to_check: + return False + bundle = self._bundles_to_check.pop() self.emit('progress', UpdateModel.ACTION_CHECKING, bundle.get_name(), current, total) -- cgit v0.9.1