diff --git a/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py b/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py index 26801e10c..82ffb25d9 100644 --- a/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py +++ b/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py @@ -23,6 +23,9 @@ def boot_to_fastboot(self): return self.call("boot_to_fastboot") def _upload_file_if_needed(self, file_path: str, operator: Operator | None = None) -> str: + if not file_path or not file_path.strip(): + raise ValueError("File path cannot be empty. Please provide a valid file path.") + if operator is None: path_buf, operator, operator_scheme = operator_for_path(file_path) else: @@ -91,6 +94,13 @@ def flash( partitions = {partition: path} operators = {partition: operator} if isinstance(operator, Operator) else None + for partition_name, file_path in partitions.items(): + if not file_path or not file_path.strip(): + raise ValueError( + f"Partition '{partition_name}' has an empty file path. " + f"Please provide a valid file path (e.g., -t {partition_name}:/path/to/image)" + ) + self.logger.info("Starting RideSX flash operation") self.boot_to_fastboot()