Skip to content

Commit

Permalink
add check for variable in gutenberg_is_block_editor function to preve…
Browse files Browse the repository at this point in the history
…nt failure (#16201)
  • Loading branch information
myleshyson authored and aduth committed Jun 25, 2019
1 parent 736adf3 commit 9b8714e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function gutenberg_is_block_editor() {
return false;
}
$screen = get_current_screen();
return $screen->is_block_editor() || 'gutenberg_page_gutenberg-widgets' === $screen->id;
return ! empty( $screen ) && ( $screen->is_block_editor() || 'gutenberg_page_gutenberg-widgets' === $screen->id );
}

/**
Expand Down

0 comments on commit 9b8714e

Please sign in to comment.