Skip to content

Commit

Permalink
Plugin: Account for null return of get_current_screen (#14558)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored Mar 22, 2019
1 parent ab136c2 commit 9bcf036
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function is_gutenberg_page() {
_deprecated_function( __FUNCTION__, '5.3.0', 'WP_Screen::is_block_editor' );

require_once ABSPATH . 'wp-admin/includes/screen.php';
return get_current_screen()->is_block_editor();
$screen = get_current_screen();
return ! is_null( $screen ) && get_current_screen()->is_block_editor();
}

/**
Expand Down Expand Up @@ -159,5 +160,6 @@ function gutenberg_init() {
_deprecated_function( __FUNCTION__, '5.3.0' );

require_once ABSPATH . 'wp-admin/includes/screen.php';
return get_current_screen()->is_block_editor();
$screen = get_current_screen();
return ! is_null( $screen ) && get_current_screen()->is_block_editor();
}

0 comments on commit 9bcf036

Please sign in to comment.