Sure, this is a good idea (from the proposed patch):
+ # safety check
+ [ "${diaspora_user_home}" != "" ] || exit 1
+ [ "${diaspora_home}" != "" ] || exit 1
... but this is key IMO: +# Abort if any unbound variables are used
+#set -u
I often use "set -euo pipefail" in my bash scripts. It does come with some caveats, though.