WMZDropDownMenu icon indicating copy to clipboard operation
WMZDropDownMenu copied to clipboard

更新 ui 的时候,self.lastSelectIndex 好像没有更新,会导致崩溃

Open zgGitHub opened this issue 2 years ago • 0 comments

代码位置:WMZDropDownMenu 文件, - (void)judgeBtnTitle:(WMZDropMenuBtn*)sender 方法,第431 行,有可能出现数组越界的崩溃

我在如下判断里面加了 self.titleBtnArr.count>self.lastSelectIndex的判断

if (!self.close&&
                  self.lastSelectIndex >= 0 && self.titleBtnArr.count>self.lastSelectIndex) {
                  WMZDropMenuBtn *lastBtn = self.titleBtnArr[self.lastSelectIndex];
                  [self dataChangeActionSection:[self getTitleFirstDropWthTitleBtn:lastBtn].section WithKey:nil];
              }

zgGitHub avatar Jul 06 '23 09:07 zgGitHub