From cb783ec4e8414937ea1491eea8aed07dce006f3b Mon Sep 17 00:00:00 2001 From: Mischa Spelt Date: Sat, 23 Sep 2017 13:22:24 +0200 Subject: [PATCH] Fix bug with podcasts incorrectly linked to program --- common/classes/Podcast.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/classes/Podcast.php b/common/classes/Podcast.php index aea724c..741596c 100644 --- a/common/classes/Podcast.php +++ b/common/classes/Podcast.php @@ -25,11 +25,12 @@ class Podcast extends Model { $this->auth = $this->key; } - if(isset($data->program) && $data->program) { + if(isset($data->program)) { + $this->program = null; if(is_object($data->program)) { $this->program = new \Model\Program($data->program); - } else { - $this->program = new \Model\Program(['id' => $this->program, 'name' => $data->program_name, 'description' => $data->program_description]); + } elseif($data->program) { + $this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]); } } }