diff options
author | Michael Stone <michael@laptop.org> | 2011-01-21 20:23:53 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2011-02-05 15:25:17 (GMT) |
commit | c048c1872a020a07b07139fa3bfe370adbb1ebcc (patch) | |
tree | 9d4bba51902b859c18db7d3cad076e5ef34efdd8 /extensions | |
parent | 1eb4c7756fbe10a3a77636f7c720ffa200a9a64e (diff) |
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 <michael@laptop.org>
[style fix]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Reviewed-by: Sascha Silbe <silbe@activitycentral.com>
Reviewed-by: Aleksey Lim <alsroot@member.fsf.org>
Diffstat (limited to 'extensions')
-rwxr-xr-x | extensions/cpsection/updater/model.py | 3 |
1 files changed, 3 insertions, 0 deletions
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) |