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

Guard against boolean return value from get_latest_events() #688

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kadamwhite
Copy link

We've observed an issue in some of our test environments where the Alert_Manager::get_latest_events method returned false (indicating that connectivity was lost), which is a TypeError on recent versions of PHP because count requires its argument to be countable.

This patch ensures that the admin will load even if the get_latest_events method returns false.

We've observed an issue in a test environment where the `Alert_Manager::get_latest_events` method returned `false` (indicating that connectivity was lost), which is a TypeError on recent versions of PHP because `count` requires its argument to be countable. When using `declare( strict_types=1 );`, this error prevents the admin from loading when this situation occurs.

This patch ensures that the admin will load even if the get_latest_events method returns false.
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.

None yet

1 participant