From 737499b1e9f328099f92e5d13e7feb7df52a9675 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 7 Apr 2024 20:12:45 -0400 Subject: [PATCH] Fix voucher screen crash --- src/ui/vouchers-ui-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/vouchers-ui-handler.ts b/src/ui/vouchers-ui-handler.ts index 96ef7984a..3f41cf9ae 100644 --- a/src/ui/vouchers-ui-handler.ts +++ b/src/ui/vouchers-ui-handler.ts @@ -205,7 +205,7 @@ export default class VouchersUiHandler extends MessageUiHandler { this.updateVoucherIcons(); - this.showVoucher(vouchers[Object.keys(vouchers)[this.cursor + this.scrollCursor * itemCols]]); + this.showVoucher(vouchers[Object.keys(vouchers)[Math.min(this.cursor + this.scrollCursor * itemCols, Object.values(vouchers).length - 1)]]); return true; }