Opened 3 years ago
Closed 2 years ago
#56482 closed defect (bug) (wontfix)
potential null pointer error
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.0.2 |
| Component: | Script Loader | Keywords: | has-patch php81 |
| Focuses: | Cc: |
Description (last modified by )
In wp-includes/script-loader.php near line 2406 within function wp_global_styles_render_svg_filters() the function get_current_screen() can be null causing a null pointer.
Proposal is to add a null check before use:
if (
is_admin() &&
get_current_screen() != null &&
! get_current_screen()->is_block_editor()
)
Change History (4)
This ticket was mentioned in PR #3163 on WordPress/wordpress-develop by kbiegert.
3 years ago
#1
- Keywords has-patch added
#3
@
3 years ago
- Keywords php81 added
PHP does not have the concept of a null point error.
I presume you mean you are seeing a "passing null to non-nullable" deprecation notice on PHP 8.1 ?
#4
@
2 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
The wp_global_styles_render_svg_filters() function where this error occurred is deprecated in WP 6.3 via [56101] / #58555.
The issue within the function is not fixed. However, Core no longer calls this function. Since it's deprecated, it should no longer be used.
I'll close this ticket as wontfix. I'm using that resolution type because the function itself will not be changed now that it's deprecated.
Thank you everyone for your contributions!
Prevent null pointer.
Trac ticket: [](https://core.trac.wordpress.org/ticket/56482#ticket)