Stop error when exiting menus without making a selection.

This commit is contained in:
Storm Dragon
2025-08-06 14:11:23 -04:00
parent 7548db668a
commit 93f92b3c7b

View File

@ -511,6 +511,10 @@ download_named() {
# Required arguments: filename url
# Only works with one file at a time.
local dest="$1"
# Validate arguments
if [[ -z "$dest" ]] || [[ -z "$2" ]]; then
return 1
fi
# Remove the destination file if it is empty.
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
@ -613,6 +617,9 @@ game_installer() {
# Show game selection dialog
game="$(ui_menu "Game Installer" "Game Installer" "Please select a game to install" "${menuList[@]}")"
# Handle selection
if [[ -z "$game" ]]; then
exit 0
fi
if [[ -n "$game" ]]; then
if [[ "$game" == "Donate" ]]; then
open_url "https://ko-fi.com/stormux"