From 93271c5c0a98290a0badec8346e264ce937d8092 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 20 Dec 2022 14:04:01 +0200 Subject: [PATCH] Check for empty sources in Tar::create_target --- source/tar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.45.2