AmericanWhitewater / aw-ios

American Whitewater's iOS app
5 stars 2 forks source link

Fix run list crash #269

Closed Gregliest closed 2 years ago

Gregliest commented 2 years ago

Fix the crash in the run list view controller.

Selecting the cell for the "no results" state was causing the crash.

yeahphil commented 2 years ago

LGTM to fix the crash (I didn't test it by running the app, but that should do the trick). You could also add a guard in tableView(_:didSelectRowAt:) but either one will be OK.

There's a deeper issue here which is a bunch of table views in the app put all their data in section 0. If there's no data, they have 1 cell in section 1 and that cell shows an empty state. I haven't seen that before and it feels weird. I guess there's no reason why it doesn't work, but it makes it really easy to slip and have bugs like this. Might be worth refactoring that at some point.