diff --git a/bin/process_export_aggregate.sh b/bin/process_export_aggregate.sh
index f9a7e78..c822030 100755
--- a/bin/process_export_aggregate.sh
+++ b/bin/process_export_aggregate.sh
@@ -145,6 +145,10 @@ if $help_mode; then
 fi
 
 # check the output directory
+if [ -z "$out_dir" ]; then
+	echo "ERROR: $script_name: no output directory specified" >&2
+	exit 2
+fi
 if [ ! -d "$out_dir" ]; then
 	echo "ERROR: $script_name: directory does not exist: $out_dir" >&2
 	exit 2
diff --git a/bin/process_main_aggregate.sh b/bin/process_main_aggregate.sh
index 36cb343..b38831b 100755
--- a/bin/process_main_aggregate.sh
+++ b/bin/process_main_aggregate.sh
@@ -161,6 +161,10 @@ if $help_mode; then
 fi
 
 # check the output directory
+if [ -z "$out_dir" ]; then
+	echo "ERROR: $script_name: no output directory specified" >&2
+	exit 2
+fi
 if [ ! -d "$out_dir" ]; then
 	echo "ERROR: $script_name: directory does not exist: $out_dir" >&2
 	exit 2