summaryrefslogtreecommitdiff
path: root/apt-private/private-output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-private/private-output.cc')
-rw-r--r--apt-private/private-output.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 4e18030ab..9944ab002 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -199,10 +199,12 @@ static std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &reco
std::string ShortDescription = "(none)";
if(ver)
{
- pkgCache::DescIterator Desc = ver.TranslatedDescription();
- pkgRecords::Parser & parser = records.Lookup(Desc.FileList());
-
- ShortDescription = parser.ShortDesc();
+ pkgCache::DescIterator const Desc = ver.TranslatedDescription();
+ if (Desc.end() == false)
+ {
+ pkgRecords::Parser & parser = records.Lookup(Desc.FileList());
+ ShortDescription = parser.ShortDesc();
+ }
}
return ShortDescription;
}
@@ -222,11 +224,14 @@ static std::string GetLongDescription(pkgCacheFile &CacheFile, pkgRecords &recor
return EmptyDescription;
pkgCache::DescIterator const Desc = ver.TranslatedDescription();
- pkgRecords::Parser & parser = records.Lookup(Desc.FileList());
- std::string const longdesc = parser.LongDesc();
- if (longdesc.empty() == true)
- return EmptyDescription;
- return SubstVar(longdesc, "\n ", "\n ");
+ if (Desc.end() == false)
+ {
+ pkgRecords::Parser & parser = records.Lookup(Desc.FileList());
+ std::string const longdesc = parser.LongDesc();
+ if (longdesc.empty() == false)
+ return SubstVar(longdesc, "\n ", "\n ");
+ }
+ return EmptyDescription;
}
/*}}}*/
void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/