From: Mikko Rasa Date: Thu, 11 Feb 2010 08:22:40 +0000 (+0000) Subject: Don't segfault on missing packages X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0e603ddd5885dc9e3c369827ea97f69a70f179c9;p=builder.git Don't segfault on missing packages --- 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);