What does [ -z "$1" ] detect before the file-processing loop begins?
[ -z "$1" ]
The first argument is an empty string, indicating no directory path was supplied.
The first argument names an existing directory.
The script has executable permission.
The selected directory contains zero files.