From 768f695f6bd73fbad62866f8b884daf0edc96a6a Mon Sep 17 00:00:00 2001 From: Ludy Date: Sat, 19 Jul 2025 02:09:22 +0200 Subject: [PATCH] Update app/common/src/main/java/stirling/software/common/util/GeneralUtils.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../main/java/stirling/software/common/util/GeneralUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java b/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java index bea280fc8..3aed62271 100644 --- a/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java +++ b/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java @@ -448,6 +448,10 @@ public class GeneralUtils { * path. */ public static Path extractScript(String scriptName) throws IOException { + // Validate input + if (scriptName == null || scriptName.trim().isEmpty()) { + throw new IllegalArgumentException("scriptName must not be null or empty"); + } // 1. load the script from classpath ClassPathResource resource = new ClassPathResource("static/python/" + scriptName);