X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3b3a681c79d3e5c32fcd6ccb87e74e5ca6e234b4..3cb3fe76e90283a5b3fe7105e4854d4bac13bfeb:/apt-pkg/policy.cc diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 4f9d56775..5427271b6 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -45,6 +45,8 @@ using namespace std; file matches the V0 policy engine. */ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner) { + if (Owner == 0 || &(Owner->Head()) == 0) + return; PFPriority = new signed short[Owner->Head().PackageFileCount]; Pins = new Pin[Owner->Head().PackageCount]; @@ -328,7 +330,7 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) if (File.empty() == true) File = _config->FindFile("Dir::Etc::Preferences"); - if (FileExists(File) == false) + if (RealFileExists(File) == false) return true; FileFd Fd(File,FileFd::ReadOnly);