summaryrefslogtreecommitdiff
path: root/apt-private/private-search.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-private/private-search.cc')
-rw-r--r--apt-private/private-search.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/apt-private/private-search.cc b/apt-private/private-search.cc
index ecd5d7fad..e218bf76c 100644
--- a/apt-private/private-search.cc
+++ b/apt-private/private-search.cc
@@ -31,9 +31,13 @@ bool FullTextSearch(CommandLine &CmdL) /*{{{*/
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
+ if (unlikely(Cache == NULL))
+ return false;
+
pkgDepCache::Policy *Plcy = CacheFile.GetPolicy();
pkgRecords records(CacheFile);
- if (unlikely(Cache == NULL || Plcy == NULL))
+
+ if (unlikely(Plcy == NULL))
return false;
const char **patterns;