Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objective-C init extension to better handle null model dictionary in prod builds #80

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

nguyenhuy
Copy link
Member

  • The generated initializer asserts the nullability of its model dictionary parameter. But since assertions are turned off by default for prod builds, the initializer proceeds and causes a NSInvalidErgumentException: "-[NSNull objectForKeyedSubscript:]: unrecognized selector sent to instance".
  • Fix by checking nullability and bail early.
  • Update Cocoa examples to include this new check.

screen shot 2017-09-20 at 12 39 48 pm

…prod builds

- The generated initializer asserts the nullability of its model dictionary parameter. But since assertions are turned off by default for prod builds, the initializer proceeds and causes a NSInvalidErgumentException: "-[NSNull objectForKeyedSubscript:]: unrecognized selector sent to instance".
- Fix by checking nullability and bail early.
- Update Cocoa examples to include this new check.
@ghost
Copy link

ghost commented Sep 20, 2017

1 Warning
⚠️ Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by 🚫 Danger

@rahul-malik rahul-malik merged commit f8378f6 into pinterest:master Sep 20, 2017
@nguyenhuy nguyenhuy deleted the HNNilDictHandling branch September 20, 2017 14:56
nguyenhuy added a commit to nguyenhuy/plank that referenced this pull request Sep 26, 2017
…prod builds (pinterest#80)

- The generated initializer asserts the nullability of its model dictionary parameter. But since assertions are turned off by default for prod builds, the initializer proceeds and causes a NSInvalidErgumentException: "-[NSNull objectForKeyedSubscript:]: unrecognized selector sent to instance".
- Fix by checking nullability and bail early.
- Update Cocoa examples to include this new check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants