diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-05-14 00:06:56 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-05-18 22:22:24 +0200 |
commit | e61886cacbc5411ea027e3a3d1d5c31793ed2b71 (patch) | |
tree | 69f17913edd3f29f1571b46aec0b2a07d088194e | |
parent | 1f641cf70e9cd52c093b4b62dc392f29cf34f03e (diff) |
private-search: Only use V.TranslatedDescription() if good
When we could not find a translated description, we were
pushing V.TranslatedDescription() to the vector, but that
one might not have been good either.
Add the check so we don't crash later when trying to access
it.
LP: #1877987
-rw-r--r-- | apt-private/private-search.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc index b3f9469ac..b2114740e 100644 --- a/apt-private/private-search.cc +++ b/apt-private/private-search.cc @@ -42,7 +42,7 @@ static std::vector<pkgCache::DescIterator> const TranslatedDescriptionsList(pkgC Descriptions.push_back(Desc); } - if (Descriptions.empty()) + if (Descriptions.empty() && V.TranslatedDescription().IsGood()) Descriptions.push_back(V.TranslatedDescription()); return Descriptions; |