From c50a0eca649023d1c5984a1375c5918a620395d1 Mon Sep 17 00:00:00 2001 From: Tyurin Kirill <1337soundwave1337@gmail.com> Date: Tue, 4 Oct 2022 19:30:44 +0500 Subject: [PATCH] fix get_name() on null error --- src/Parser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Parser.php b/src/Parser.php index 0fe564f..47d3744 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -320,9 +320,13 @@ class Parser $episode = new Episode(); $episode->setTitle($item->get_title()) ->setDescription($item->get_description()) - ->setAuthor($item->get_author()->get_name()) ->setLink($item->get_link()); + $author = $item->get_author(); + if (!is_null($author)) { + $episode->setAuthor($author->get_name()); + } + if ($this->config->shouldDefaultToToday()) { $episode->setPublishedDate(new \DateTime($item->get_date())); } else {