From ed6360a904f8082f4048332640e5f09ca9989854 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 2 Sep 2021 10:51:59 +0100 Subject: [PATCH] [Minor] Explicitly disallow to set settings on top of other settings --- src/lua/lua_task.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eabbb2609..b095de8e7 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -5661,6 +5661,13 @@ lua_task_set_settings (lua_State *L) if (settings != NULL && task != NULL) { + if (task->settings) { + /* Do not allow to set settings on top of the existing ones */ + ucl_object_unref (settings); + + return luaL_error (L, "invalid invocation: settings has been already set"); + } + metric_elt = ucl_object_lookup (settings, DEFAULT_METRIC); if (metric_elt) { -- 2.39.5