-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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 "Trying to access array offset on null" warning #20294
Conversation
… value of `error_get_last()` can be `null` yiisoft#17365
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20294 +/- ##
============================================
- Coverage 64.84% 63.42% -1.43%
- Complexity 11412 11417 +5
============================================
Files 431 431
Lines 37147 37155 +8
============================================
- Hits 24088 23565 -523
- Misses 13059 13590 +531 ☔ View full report in Codecov by Sentry. |
Btw, can find more similar code-block, i.e. $error = error_get_last();
Yii::warning("...: {$error['message']}", __METHOD__); and I guess the same kind of problem might arise with them. However, I like the approach in the class yii2/framework/web/Session.php Lines 163 to 165 in 49cfd3b
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Would you please add a line for CHANGELOG? Thanks.
@samdark how about this one? Should fix 'em all? |
Done ✅ |
Worth fixing all these if you're sure the issue could occur. |
LGTM although I prefer classic ifs. |
@mtangoo I was thinking about it. Well, there is no standard: somewhere I can see I can start a separate dedicated PR. |
Done ✅ |
I think we are good to go. @xcopy thanks for your time and effort. If you feel you can tackle another PR, feel free to do so! |
Note: this does not solve the whole problem described in the issue #17365, but only part of it.