From 1dacdd46375204b93855098a7357272e81beb5d0 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 1 Jan 2020 15:02:23 -0700 Subject: [PATCH] Abort if an invalid image destination selected --- scripts/wk/hw/ddrescue.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 99b8f075..3780714a 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -1244,7 +1244,11 @@ def get_working_dir(mode, destination, force_local=False): # Use preferred path if possible if mode == 'Image': - path = pathlib.Path(destination).resolve() + try: + path = pathlib.Path(destination).resolve() + except TypeError: + std.print_error(f'Invalid destination: {destination}') + raise std.GenericAbort() if path.exists() and fstype_is_ok(path, map_dir=False): working_dir = path elif mode == 'Clone' and not force_local: