]> git.saurik.com Git - cydia.git/commitdiff
Fix crash on Changes tab due to section index out of bounds
authorRyan Petrich <rpetrich@gmail.com>
Mon, 3 Jan 2011 08:28:47 +0000 (01:28 -0700)
committerRyan Petrich <rpetrich@gmail.com>
Mon, 3 Jan 2011 08:28:47 +0000 (01:28 -0700)
MobileCydia.mm

index 3837d7b6ecfd52b37456ff0b2d37b0bc2833a00f..dc0f87daf5f756f980d9ce176486cf052af83c45 100644 (file)
@@ -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];
 } }