Skip to content

Commit

Permalink
Add catching around getting the post ID in the FSE Template helper (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivia Wolski authored Jul 17, 2019
1 parent 1e8aeb8 commit 4612c22
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ class A8C_WP_Template {
*/
public function __construct( $post_id = null ) {
if ( null === $post_id ) {
$post_id = get_post()->ID;
$post = get_post();

if ( ! $post ) {
return;
}

$post_id = $post->ID;
}

$this->current_post_id = $post_id;
Expand Down

0 comments on commit 4612c22

Please sign in to comment.