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

Add null check before method_exists #2417

Merged
merged 1 commit into from
Aug 12, 2022
Merged

Conversation

holozaen
Copy link
Contributor

Beginning with version 8.0, PHP throws a type error if the first parameter is neither an object or a class, so the translate method breaks if the translator key is not set to the editor config (which can be the case by the way).

We could also use an early return to fix the issue here, but in my opinion the translation method stays understandable and simple enough so the additional check for an existing translator can be added to the IF-statement.

Beginning with version 8.0, PHP throws a type error if the first parameter is neither an object or a class, so the translate method breaks if the translator key is not set to the editor config (which can be the case by the way). We could also use an early return to fix the issue here, but in my opinion the translation method stays understandable and simple enough so the additional check for an existing translator can be added to the IF-statement.
@github-actions github-actions bot added Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* labels Aug 12, 2022
@Flyingmana Flyingmana merged commit 6469749 into OpenMage:1.9.4.x Aug 12, 2022
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
7 runs  ±0  5 ✔️ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 6469749. ± Comparison against base commit 7a4e462.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants