City-of-Bloomington / open311-ios

GeoReporter iOS source code. Native iOS smartphone client app for Open311 API civic issue reporting.
http://open311.org
Other
23 stars 22 forks source link

Crash when loading serviceDefinition for report #198

Closed inghamn closed 11 years ago

inghamn commented 11 years ago

When attempting to do a report for Streets->Bicycling & Walking, the app crashes with:

*\ Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (1) beyond bounds (1)'

This refers to line 199 of NewReportController

I'm not sure if it's an off-by-one problem, or if it is data corruption while loading the serviceDefinition.

This happens on both the iPhone 3 iOS 6 and an iPhone 4 iOS 7. However, it does not happen on the simulators.

inghamn commented 11 years ago

It looks like it is an off-by-one error. The Bicycling and & Walking service only has one attribute. It should be called using a zero. However, NewReportController is using the indexPath.row, which starts at one.

inghamn commented 11 years ago

Fixed in 0cb7786992f34d8c5a77a8282fd5709bfdadcc7c