]> git.bts.cx Git - cx.git/blobdiff - cx/lib/posts.php
Don't break when there's no hero image
[cx.git] / cx / lib / posts.php
index 2c2dc821e811bfc0fe94d66823a28f0af7940ce3..0a2ac4d997ff9c5133c0c0a27cffc6e4ee376f9e 100644 (file)
@@ -15,8 +15,8 @@ class PostMetadata {
        public $hero_image_alt;
 
        public function __construct($dict) {
-               $this->hero_image = $dict['post_hero_image'];
-               $this->hero_image_alt = $dict['post_hero_image_alt'];
+               $this->hero_image = isset($dict['post_hero_image']) ? $dict['post_hero_image'] : null;
+               $this->hero_image_alt = isset($dict['post_hero_image_alt']) ? $dict['post_hero_image_alt'] : null;
        }
 }