Merge lp:~gary-lasker/software-center/fix-crash-lp943605 into lp:software-center

Proposed by Gary Lasker on 2012-03-20
Status: Merged
Merged at revision: 2893
Proposed branch: lp:~gary-lasker/software-center/fix-crash-lp943605
Merge into: lp:software-center
Diff against target: 18 lines (+5/-2)
1 file modified
softwarecenter/db/application.py (+5/-2)
To merge this branch: bzr merge lp:~gary-lasker/software-center/fix-crash-lp943605
Reviewer Review Type Date Requested Status
software-store-developers 2012-03-20 Pending
Review via email: mp+98337@code.launchpad.net

Description of the change

Don't crash if a valid value for the version is not returned by the call to _get_version_for_archive_suite. See corresponding bug 943605 for details and stack trace.

Thanks!

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Thanks, looks good! I did a minor tweak to include the pkgname without the version in the log output.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/db/application.py'
2--- softwarecenter/db/application.py 2012-03-16 18:51:40 +0000
3+++ softwarecenter/db/application.py 2012-03-20 04:58:18 +0000
4@@ -725,9 +725,12 @@
5 else:
6 ver = self._get_version_for_archive_suite(
7 self._pkg, self._app.archive_suite)
8- return ver.version
9- elif self._doc:
10+ if ver:
11+ return ver.version
12+ if self._doc:
13 return self._doc.get_value(XapianValues.VERSION_INFO)
14+ LOG.warn("no version information found")
15+ return ""
16
17 def get_not_automatic_archive_versions(self):
18 """ this will return list of tuples (version, archive_suites)

Subscribers

People subscribed via source and target branches