From bc20872b6d211550c1dc36039c5bc56884f86f80 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Sun, 8 Aug 2021 20:45:57 -0500 Subject: [PATCH] fix bug when no patch selected --- patch-menu | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patch-menu b/patch-menu index daf0db8..81b171e 100755 --- a/patch-menu +++ b/patch-menu @@ -22,6 +22,7 @@ yad --title="Build a Pi Patch Tool" --width=500 --height=500 \ --button="Apply Patch":2) BUT=$? + PATCH=$(echo ${INFO} | awk -F "|" '{print $1}') #cleanup and exit upon user request @@ -32,6 +33,17 @@ rm -rf $TEMP $DIR/pi-build ${MYPATH}/update && exit fi + +#check to verify that a patch has been selected +#Thank Ken, NB6S for catching this bug! +if [ -z $INFO ]; then + yad --form --width=500 --text-align=center --center --title="Build-a-Pi Patch Tool" --text-align=center \ + --image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \ + --text="Please select a patch\rand try again." \ + --button=gtk-close +MENU +fi + #verify patch has not been applied already echo "getting patchname" PATCHNAME=$(grep PATCHNAME= $DIR/pi-build/patch/${PATCH} | sed 's/PATCHNAME=//')