diff options
author | Ryan Petrich <rpetrich@gmail.com> | 2011-01-03 01:28:47 -0700 |
---|---|---|
committer | Ryan Petrich <rpetrich@gmail.com> | 2011-01-03 01:28:47 -0700 |
commit | b9fed9bc261c54a9f81815cbc48c2a8caa77a2ff (patch) | |
tree | cdc025397cee3ac93ef09c8e987cf29293545539 | |
parent | 1e94d48bab22034f48a4f7846697b3d443476f30 (diff) |
Fix crash on Changes tab due to section index out of bounds
-rw-r--r-- | MobileCydia.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 3837d7b..dc0f87d 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7483,7 +7483,10 @@ freeing the view controllers on tab change */ if ([database_ era] != era_) return nil; - Section *section([sections_ objectAtIndex:[path section]]); + NSUInteger sectionIndex([path section]); + if (sectionIndex >= [sections_ count]) + return nil; + Section *section([sections_ objectAtIndex:sectionIndex]); NSInteger row([path row]); return [[[self packageAtIndex:([section row] + row)] retain] autorelease]; } } |