Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Null assigned to signals in StopWorkerOnSignalsListener #50529

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
shyim opened this issue Jun 1, 2023 · 0 comments · Fixed by #50532
Closed

[Messenger] Null assigned to signals in StopWorkerOnSignalsListener #50529

shyim opened this issue Jun 1, 2023 · 0 comments · Fixed by #50532

Comments

@shyim
Copy link
Contributor

shyim commented Jun 1, 2023

Symfony version(s) affected

6.3.0

Description

We get in our pipeline the following error:

Cannot assign null to property Symfony\Component\Messenger\EventListener\StopWorkerOnSignalsListener::$signals of type array

It seems like when SIGTERM is not defined it assigns null to the typed array property.

How to reproduce

  • Remove somehow the SIGTERM constant (Don't having installed php extension)
  • Construct StopWorkerOnSignalsListener
  • It will run into that exception

Possible Solution

Check for that constant and throw error when not existing

Additional Context

No response

@shyim shyim added the Bug label Jun 1, 2023
@fabpot fabpot closed this as completed Jun 2, 2023
fabpot added a commit that referenced this issue Jun 2, 2023
…` to be assigned to null in case `SIGTERM` constant doesn't exist (alexandre-daubois)

This PR was merged into the 6.3 branch.

Discussion
----------

[Messenger] Prevent `StopWorkerOnSignalsListener::$signals` to be assigned to null in case `SIGTERM` constant doesn't exist

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #50529
| License       | MIT
| Doc PR        | _NA_

Prevents the non-nullable property to be assigned to null 🙂

Commits
-------

538a9ab [Messenger] Prevent `StopWorkerOnSignalsListener::$signals` to be assigned to null in case `SIGTERM` constant doesn't exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants