diff --git a/msm-firmware-loader.sh b/msm-firmware-loader.sh
index c404553..d2c06a8 100644
--- a/msm-firmware-loader.sh
+++ b/msm-firmware-loader.sh
@@ -25,11 +25,14 @@ set -x
 # https://source.android.com/docs/core/architecture/bootloader/updating#slots
 ab_get_slot() {
        if command -v qbootctl > /dev/null; then
-               ab_slot_suffix=$(qbootctl -a | grep -o 'Active slot: ..' | cut -d ":" -f2 | xargs) || :
+               ab_slot_suffix=$(qbootctl -a | grep -oE 'Active slot: ((_[ab])|(\(null\)))' | cut -d ":" -f2 | xargs) || :
        else
                ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline |  cut -d "=" -f2) || :
        fi
-       echo "$ab_slot_suffix"
+       if [ "$ab_slot_suffix" != "(null)" ]
+       then
+               echo "$ab_slot_suffix"
+       fi
 }

 # Configurations:
