Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Attempt to read property "post_name" on null

Exception

ErrorException

  1. {
  2.     global $post;
  3.     if (is_archive()) {
  4.         $classes[] = 'archive-' $post->post_type;
  5.     }
  6.     $classes[] = $post->post_name;
  7.     return $classes;
  8. }
  9. /**
  10.  * @param $asset
  1.      * @throws \ErrorException
  2.      */
  3.     public function handleError($level$message$file ''$line 0$context = [])
  4.     {
  5.         try {
  6.             parent::handleError($level$message$file$line$context);
  7.         } catch (Throwable $e) {
  8.             if (! apply_filters('acorn/throw_error_exception'true$e)) {
  9.                 return false;
  10.             }
HandleExceptions->handleError() in /home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/functions.php (line 171)
  1. {
  2.     global $post;
  3.     if (is_archive()) {
  4.         $classes[] = 'archive-' $post->post_type;
  5.     }
  6.     $classes[] = $post->post_name;
  7.     return $classes;
  8. }
  9. /**
  10.  * @param $asset
  1.                 if ( === $the_['accepted_args'] ) {
  2.                     $value call_user_func$the_['function'] );
  3.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  4.                     $value call_user_func_array$the_['function'], $args );
  5.                 } else {
  6.                     $value call_user_func_array$the_['function'], array_slice$args0$the_['accepted_args'] ) );
  7.                 }
  8.             }
  9.         } while ( false !== next$this->iterations$nesting_level ] ) );
  10.         unset( $this->iterations$nesting_level ] );
WP_Hook->apply_filters() in /home/gocv/go-cv.co.uk/wp-includes/plugin.php (line 205)
  1.     }
  2.     // Pass the value to WP_Hook.
  3.     array_unshift$args$value );
  4.     $filtered $wp_filter$hook_name ]->apply_filters$value$args );
  5.     array_pop$wp_current_filter );
  6.     return $filtered;
  7. }
  1.      * @since 2.8.0
  2.      *
  3.      * @param string[] $classes   An array of body class names.
  4.      * @param string[] $css_class An array of additional class names added to the body.
  5.      */
  6.     $classes apply_filters'body_class'$classes$css_class );
  7.     return array_unique$classes );
  8. }
  9. /**
  1.             ->getPossibleViewNameFromPath($file realpath($file));
  2.         $view trim($view'\\/.');
  3.         /** Gather data to be passed to view */
  4.         $data array_reduce(get_body_class(), function ($data$class) use ($view$file) {
  5.             return apply_filters("sage/template/{$class}/data"$data$view$file);
  6.         }, []);
  7.         $this->app['sage.view'] = $this->view->exists($view) ? $view $file;
  8.         $this->app['sage.data'] = $data;
Sage->filterTemplateInclude() in /home/gocv/go-cv.co.uk/wp-includes/class-wp-hook.php (line 324)
  1.                 // Avoid the array_slice() if possible.
  2.                 if ( === $the_['accepted_args'] ) {
  3.                     $value call_user_func$the_['function'] );
  4.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  5.                     $value call_user_func_array$the_['function'], $args );
  6.                 } else {
  7.                     $value call_user_func_array$the_['function'], array_slice$args0$the_['accepted_args'] ) );
  8.                 }
  9.             }
  10.         } while ( false !== next$this->iterations$nesting_level ] ) );
WP_Hook->apply_filters() in /home/gocv/go-cv.co.uk/wp-includes/plugin.php (line 205)
  1.     }
  2.     // Pass the value to WP_Hook.
  3.     array_unshift$args$value );
  4.     $filtered $wp_filter$hook_name ]->apply_filters$value$args );
  5.     array_pop$wp_current_filter );
  6.     return $filtered;
  7. }
  1.      *
  2.      * @since 3.0.0
  3.      *
  4.      * @param string $template The path of the template to include.
  5.      */
  6.     $template apply_filters'template_include'$template );
  7.     if ( $template ) {
  8.         include $template;
  9.     } elseif ( current_user_can'switch_themes' ) ) {
  10.         $theme wp_get_theme();
  11.         if ( $theme->errors() ) {
require_once('/home/gocv/go-cv.co.uk/wp-includes/template-loader.php') in /home/gocv/go-cv.co.uk/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH WPINC '/template-loader.php';
  5. }
require('/home/gocv/go-cv.co.uk/wp-blog-header.php') in /home/gocv/go-cv.co.uk/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define'WP_USE_THEMES'true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Attempt to read property "post_name" on null

  at /home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/functions.php:171
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
     (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:54)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError()
     (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/functions.php:171)
  at custom_body_class()
     (/home/gocv/go-cv.co.uk/wp-includes/class-wp-hook.php:326)
  at WP_Hook->apply_filters()
     (/home/gocv/go-cv.co.uk/wp-includes/plugin.php:205)
  at apply_filters()
     (/home/gocv/go-cv.co.uk/wp-includes/post-template.php:857)
  at get_body_class()
     (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/vendor/roots/acorn/src/Roots/Acorn/Sage/Concerns/FiltersTemplates.php:36)
  at Roots\Acorn\Sage\Sage->filterTemplateInclude()
     (/home/gocv/go-cv.co.uk/wp-includes/class-wp-hook.php:324)
  at WP_Hook->apply_filters()
     (/home/gocv/go-cv.co.uk/wp-includes/plugin.php:205)
  at apply_filters()
     (/home/gocv/go-cv.co.uk/wp-includes/template-loader.php:104)
  at require_once('/home/gocv/go-cv.co.uk/wp-includes/template-loader.php')
     (/home/gocv/go-cv.co.uk/wp-blog-header.php:19)
  at require('/home/gocv/go-cv.co.uk/wp-blog-header.php')
     (/home/gocv/go-cv.co.uk/index.php:17)