diff --git a/lib/galaxy/tool_util/deps/conda_util.py b/lib/galaxy/tool_util/deps/conda_util.py index 8bead7148a5d..ccc8cf2da06d 100644 --- a/lib/galaxy/tool_util/deps/conda_util.py +++ b/lib/galaxy/tool_util/deps/conda_util.py @@ -425,7 +425,7 @@ class CondaTarget: def __init__( self, package: str, version: Optional[str] = None, build: Optional[str] = None, channel: Optional[str] = None ) -> None: - if SHELL_UNSAFE_PATTERN.search(package) is not None: + if SHELL_UNSAFE_PATTERN.search(package) is not None or not package: raise ValueError(f"Invalid package [{package}] encountered.") self.capitalized_package = package self.package = package.lower() diff --git a/lib/galaxy/tool_util/deps/mulled/mulled_build.py b/lib/galaxy/tool_util/deps/mulled/mulled_build.py index be956c84a8b9..422ac0a0b605 100644 --- a/lib/galaxy/tool_util/deps/mulled/mulled_build.py +++ b/lib/galaxy/tool_util/deps/mulled/mulled_build.py @@ -527,8 +527,8 @@ def add_single_image_arguments(parser): ) -def target_str_to_targets(targets_raw): - def parse_target(target_str): +def target_str_to_targets(targets_raw: str) -> List[CondaTarget]: + def parse_target(target_str: str) -> CondaTarget: if "=" in target_str: package_name, version = target_str.split("=", 1) build = None @@ -541,8 +541,10 @@ def parse_target(target_str): target = build_target(target_str) return target - targets = [parse_target(_) for _ in targets_raw.split(",")] - return targets + if targets_raw.strip() == "": + return [] + else: + return [parse_target(_) for _ in targets_raw.split(",")] def args_to_mull_targets_kwds(args):