You can use shopt
command to change this behavior:
shopt -s nullglob
Which will not echo *
for some glob pattern that cannot be expanded.
As per BASH manual:
nullglob
If set, bash allows patterns which match no files (see Pathname Expansion above) to expand to a null string, rather than themselves.