From: Mikko Rasa Date: Tue, 20 Dec 2022 12:04:01 +0000 (+0200) Subject: Check for empty sources in Tar::create_target X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=93271c5c0a98290a0badec8346e264ce937d8092;p=builder.git Check for empty sources in Tar::create_target --- diff --git a/source/tar.cpp b/source/tar.cpp index 46f95ca..346638e 100644 --- a/source/tar.cpp +++ b/source/tar.cpp @@ -19,7 +19,7 @@ Tar::Tar(Builder &b): Target *Tar::create_target(const list &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);