[wp-trac] [WordPress Trac] #56482: potential null pointer error

WordPress Trac noreply at wordpress.org
Wed Aug 31 23:18:12 UTC 2022


#56482: potential null pointer error
---------------------------+------------------------------
 Reporter:  kbiegert       |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  6.0.2
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> 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()
>     )

New description:

 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()
     )
 }}}

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56482#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list