Closed inghamn closed 10 years ago
Ignore first comment, I have fixed and pulled here: https://github.com/City-of-Bloomington/open311-mobile/pull/205
This does not actually solve the crash problem, though.
That's strange. I can't represent it. The onliest case, when app can crash on Add Server screen and cause failure in ../AFHTTPClient.m:232, is passing nil from textFieldUrl while checkingServerValidity in AddServerController.m. So for full confidence it is better to preset all textFields with empty strings in viewDidLoad, but not only in didFinishSaving as I did before. I will make pull request shorty. If it won't help, I will search for another solution.
I tested and the error only appeared for me on iOS 6. I added an extra "if" to see if the entered URL has a valid format (if the url didn't have a valid format, checkServerValidity: in open311 crashed with error). Now, if the url is invalid, an alert message is shown. I also localized the strings in this alert using google translate.
I meant to send this as a pull request, but I committed it to the master branch by mistake. It's in 89eefc29d75fbddb3ffed681a50a79a4627b7107. For me, this fixes the problem.
I added an extra "if" to see if the entered URL has a valid format
This extra "if" confirms my previous guess, that this failure is caused by passing nil. In my opinion, solution with initialising all UITextFields with empty string is more elegant:
If you go to the Add Server screen, but do not enter anything, and instead, hit Save. The app crashes:
* Assertion failure in -[AFHTTPClient initWithBaseURL:], /Users/inghamn/Desktop/Projects/open311-mobile/GeoReporter/Pods/AFNetworking/AFNetworking/AFHTTPClient.m:232 2013-10-24 09:27:26.238 GeoReporter[180:907] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: url