summaryrefslogtreecommitdiff
path: root/apt-pkg/policy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r--apt-pkg/policy.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 2cc2e5e39..291d83c67 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -231,6 +231,9 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name,
// Get a spot to put the pin
pkgCache::GrpIterator Grp = Cache->FindGrp(Name);
+ if (Grp.end() == true)
+ return;
+
for (pkgCache::PkgIterator Pkg = Grp.PackageList();
Pkg.end() != true; Pkg = Grp.NextPkg(Pkg))
{