diff --git a/modules/custom-status/custom-status.php b/modules/custom-status/custom-status.php index c76af258..5dff10c4 100644 --- a/modules/custom-status/custom-status.php +++ b/modules/custom-status/custom-status.php @@ -1472,6 +1472,10 @@ public function fix_preview_link_part_two( $permalink, $post, $sample ) { if ( is_int( $post ) ) $post = get_post( $post ); + // This might not be a valid post at all. + if ( ! is_object( $post ) || ! isset( $post->post_type ) ) + return $permalink; + //Should we be doing anything at all? if( !in_array( $post->post_type, $this->get_post_types_for_module( $this->module ) ) ) return $permalink;