diff --git a/includes/class-newspack-segments-model.php b/includes/class-newspack-segments-model.php index d29ba0c0..ab09758e 100644 --- a/includes/class-newspack-segments-model.php +++ b/includes/class-newspack-segments-model.php @@ -352,6 +352,11 @@ public static function get_segments( $include_inactive = true ) { ] ); + // if, for any reason, this was called too early and we don't have a registered taxonomy yet, let's not break the site. + if ( ! is_array( $terms ) ) { + return []; + } + $segments = array_map( function ( $segment ) { return self::get_segment_from_term( $segment );