From a01f298a2edb864c54f3a0d900e25aaebd49c125 Mon Sep 17 00:00:00 2001 From: Ryan Petrich Date: Mon, 3 Jan 2011 01:28:47 -0700 Subject: [PATCH] Fix crash on Changes tab due to section index out of bounds --- MobileCydia.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 3837d7b6..dc0f87da 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]; } } -- 2.45.2