Skip to content

[PropertyAccess] Fix nullsafe chain like x?.y #48727

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

Closed
wants to merge 0 commits into from
Closed

Conversation

Vincz
Copy link
Contributor

@Vincz Vincz commented Dec 20, 2022

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #48726
License MIT

Fix objects reading with path like x?.y so reading should stop and return null if the property x is null.
Currently, the system tries to read the property y from the null value and raises an exception.

@nicolas-grekas
Copy link
Member

Thank you @Vincz.

nicolas-grekas added a commit that referenced this pull request Dec 23, 2022
This PR was squashed before being merged into the 6.2 branch.

Discussion
----------

[PropertyAccess] Fix nullsafe chain like x?.y

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #48726
| License       | MIT

Fix objects reading with path like `x?.y` so reading should stop and return `null` if the property `x` is null.
Currently, the system tries to read the property `y` from the `null` value and raises an exception.

Commits
-------

92db003 [PropertyAccess] Fix nullsafe chain like x?.y
@fabpot fabpot mentioned this pull request Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants