Fix undefined variable#35
Conversation
|
@claudiunicolaa |
|
Thanks for the PR @mimarcel ! |
| } | ||
| } catch (QueryException $ex){ | ||
| Log::warning("Could not persist precinct \n $precinct"); | ||
| $precinctNo = isset($rawPrecinctData['precinct_no']) ? $rawPrecinctData['precinct_no'] : "missing"; |
There was a problem hiding this comment.
Good point here! But if $rawPrecinctData['precinct_no'] or $rawPrecinctData['city_id'] aren't set, the method will throw a ErrorException with the message Undefined index: precinct_no (or city_id) at line 121.
If you have time, take into consideration before using that two array values to check if are set and if not to throw an OutOfBoundsException that will be caught as well at line 132.
Let me know on Slack if you need any help.
There was a problem hiding this comment.
I know the method was written for someone else, but now I saw that problem. 😄
There was a problem hiding this comment.
That's a good point. I changed the catch to handle all exceptions.
No description provided.