From 98b4f901e6f82417fa89f25dc39d3e92639cb656 Mon Sep 17 00:00:00 2001 From: Zak Date: Mon, 2 Mar 2026 10:39:42 +0800 Subject: [PATCH] fix: index out of range --- Sources/ESTabBar.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/ESTabBar.swift b/Sources/ESTabBar.swift index cad6bb3..0060218 100644 --- a/Sources/ESTabBar.swift +++ b/Sources/ESTabBar.swift @@ -195,6 +195,10 @@ internal extension ESTabBar /* Layout */ { } .sorted { (subview1, subview2) -> Bool in return subview1.frame.origin.x < subview2.frame.origin.x } + + guard tabBarButtons.count >= tabBarItems.count else { + return + } if isCustomizing { for (idx, _) in tabBarItems.enumerated() {