]> git.tdb.fi Git - builder.git/commitdiff
Check for empty sources in Tar::create_target
authorMikko Rasa <tdb@tdb.fi>
Tue, 20 Dec 2022 12:04:01 +0000 (14:04 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 20 Dec 2022 12:05:13 +0000 (14:05 +0200)
source/tar.cpp

index 46f95caea31c516d8fb7b6acd6a64d376f39204b..346638ea1f69b6eb534ec84be9ad5afbc22ebcb3 100644 (file)
@@ -19,7 +19,7 @@ Tar::Tar(Builder &b):
 
 Target *Tar::create_target(const list<Target *> &sources, const string &arg)
 {
-       if(!sources.front()->get_package())
+       if(sources.empty() || !sources.front()->get_package())
                throw invalid_argument("Tar::create_target");
 
        TarBall *tarball = new TarBall(builder, *sources.front()->get_package(), arg);