Skip to content

Commit d38ece8

Browse files
committed
Check that stripped script is not empty
cursor suggestion
1 parent 732df8f commit d38ece8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/primary/primary_client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ ScriptInfo PrimaryClient::prepare_script(std::string script, std::string script_
348348
// Remove all comments and white-space-only lines
349349
std::vector<std::string> stripped_script = strip_comments_and_whitespace(split_script);
350350

351+
if (stripped_script.size() == 0)
352+
{
353+
throw urcl::ScriptCodeSyntaxException("Script is empty after stripping comments and whitespace.");
354+
}
355+
351356
// Use given scipt name or create one
352357
int64_t current_time =
353358
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())

0 commit comments

Comments
 (0)