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

Fix: [Removes use of count() on result of find() #679

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

Conversation

vivaEspanaDelMu
Copy link

Status

READY

Migrations

NO

Description

The find() function on the Yii models return an object or null, and none of these implement Countable, thus count() will fail and the code will not be able to continue. The change in this makes sure that the object is compared in the if statement to give the wanted result, as in True if it is a valid object or False in case of null. Since we do not expect there to be more than one object (which is probably why find was used and not findAll or similar) it makes sense to not check count anyway.

Testing

Tested: Yes, against ca0215e

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.

1 participant