From 4399cdadb0b5429bd017f0da43aa2d858b6650cb Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 15 Feb 2026 11:49:58 +0100 Subject: [PATCH] Fix crash in volume button card switching with no other cards --- .../java/protect/card_locker/LoyaltyCardViewActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java index f62b7e84f..41566aa11 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java @@ -583,6 +583,11 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements } private void prevNextCard(boolean next) { + // If there are no other cards, don't bother switching + if (cardList == null || cardList.size() == 1) { + return; + } + // If we're in RTL layout, we want the "left" button to be "next" instead of "previous" // So we swap next around boolean transitionRight = next;