fix: firefox should not open with an empty choice

This commit is contained in:
Guilherme Rugai Freire 2021-07-31 02:30:07 -03:00
parent c884ced6fc
commit b26330a3e9

View File

@ -25,9 +25,9 @@ rm $DB
CHOICE=$(echo "$OPTIONS" | $CMD -p "Firefox quick open:")
# Check choice
URL=$(echo "$CHOICE" | awk '{print $NF}') || exit
URL=$(echo "$CHOICE" | awk '{print $NF}') || exit 0
VALID=$(echo "$OPTIONS" | grep "$URL")
if [ -n "$VALID" ]; then
if [ -n "$VALID" ] && [ -n "$CHOICE" ]; then
firefox $URL
else
exit 0