summaryrefslogtreecommitdiff
path: root/apt-private/private-cacheset.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-private/private-cacheset.h')
-rw-r--r--apt-private/private-cacheset.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index 059c7637e..0eb22b788 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -32,10 +32,15 @@ struct VersionSortDescriptionLocality
bool operator () (const pkgCache::VerIterator &v_lhs,
const pkgCache::VerIterator &v_rhs)
{
- pkgCache::DescFile *A = v_lhs.TranslatedDescription().FileList();
- pkgCache::DescFile *B = v_rhs.TranslatedDescription().FileList();
- if (A == 0 && B == 0)
- return false;
+ pkgCache::DescFile const *A = NULL;
+ pkgCache::DescFile const *B = NULL;
+ if (v_lhs->DescriptionList != 0)
+ A = v_lhs.TranslatedDescription().FileList();
+ if (v_rhs->DescriptionList != 0)
+ B = v_rhs.TranslatedDescription().FileList();
+
+ if (A == 0 && B == 0)
+ return false;
if (A == 0)
return true;