Prior to
Bash 4.4
set -u
treated empty arrays as "unset", and terminates the process.
There are a number of possible workarounds using array
parameter expansion,
however almost all of them fail in certain Bash versions.
This gist is a supplement to this StackOverflow post.