From 38fa294786c8de811dbc762d3aeba8f7c115124e Mon Sep 17 00:00:00 2001 From: Mehran Davoudi Date: Sat, 30 Dec 2023 14:08:26 +0330 Subject: [PATCH] Add error management for empty functions --- src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs b/src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs index a536453..600a876 100644 --- a/src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs +++ b/src/skUnit/Scenarios/Parsers/ChatScenarioParser.cs @@ -139,6 +139,11 @@ private static bool PackBlock(ChatScenario scenario, string newBlock, ref string var function = key; + if (string.IsNullOrWhiteSpace(function)) + { + throw new InvalidOperationException($"CALL function name is null"); + } + var arguments = new List(); if (!string.IsNullOrWhiteSpace(contentText))