From 0e603ddd5885dc9e3c369827ea97f69a70f179c9 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 11 Feb 2010 08:22:40 +0000 Subject: [PATCH] Don't segfault on missing packages --- source/builder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/builder.cpp b/source/builder.cpp index 55bee15..0b00fec 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -260,7 +260,7 @@ int Builder::main() { unsigned n_packages = 0; for(PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i) - if(i->second->is_configured()) + if(i->second && i->second->is_configured()) ++n_packages; IO::print("%d active packages, %d targets\n", n_packages, targets.size()); } @@ -610,7 +610,7 @@ int Builder::create_targets() for(PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i) { - if(!i->second->is_configured()) + if(!i->second || !i->second->is_configured()) continue; SourcePackage *spkg = dynamic_cast(i->second); -- 2.45.2