]> git.tdb.fi Git - builder.git/commitdiff
Don't segfault on missing packages
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Feb 2010 08:22:40 +0000 (08:22 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Feb 2010 08:22:40 +0000 (08:22 +0000)
source/builder.cpp

index 55bee1507c9e1253e399bb50dd2ef926d9eb1aa4..0b00fecf5c8dec0036c34a4ab69333394e2b7029 100644 (file)
@@ -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<SourcePackage *>(i->second);