diff --git a/installer.sh.in b/installer.sh.in
index 9efa749..6549dc6 100644
--- a/installer.sh.in
+++ b/installer.sh.in
@@ -624,7 +624,8 @@ menu_hostname() {
 }
 
 set_hostname() {
-    echo $(get_option HOSTNAME) > $TARGETDIR/etc/hostname
+    local hostname="$(get_option HOSTNAME)"
+    echo "${hostname:-void}" > $TARGETDIR/etc/hostname
 }
 
 menu_rootpassword() {