From 4e220a1ec5800e2f1caba02d55977a3b6f68d112 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 26 Dec 2022 21:01:30 +0200 Subject: [PATCH] Add a sanity check for derived tool commands It doesn't seem correct to copy the command in CustomizedTool, since often the derived class will want to use a different command anyway. --- source/tool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/tool.cpp b/source/tool.cpp index 82349e1..eaf4977 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -59,6 +59,9 @@ void Tool::prepare(Tool &tool) const if(&tool!=this && tool.get_base_tool()!=this) throw invalid_argument("Tool::prepare"); + if(&tool!=this && !command.empty() && tool.command.empty()) + throw logic_error("Derived tool has no command"); + do_prepare(tool); } -- 2.43.0