Skip to content

Commit b2b742c

Browse files
committed
check if post exists before querying it to replace cover image
1 parent 9b23cb7 commit b2b742c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

web/app/themes/platformlondon/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
!wp_is_json_request()
307307
) {
308308
global $post;
309-
if ($post->post_name === "projects") {
309+
if ($post && isset($post->post_name) && $post->post_name === "projects") {
310310
preg_match('#<img.*src="([^"]*)"#', $block_content, $matches);
311311
if (count($matches) !== 2) {
312312
return $block_content;

0 commit comments

Comments
 (0)