From 45ee018a6e43ce444ed4ab8f13b62e886926f779 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf <117176763+swofl@users.noreply.github.com> Date: Fri, 3 Jan 2025 01:43:39 +0100 Subject: [PATCH] [MixologyBridge] add null checks for author and timestamp elements (#4383) * [MixologyBridge] add null checks for author and timestamp elements * [MixologyBridge] fix formatting --- bridges/MixologyBridge.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bridges/MixologyBridge.php b/bridges/MixologyBridge.php index e954d0d6..42192471 100644 --- a/bridges/MixologyBridge.php +++ b/bridges/MixologyBridge.php @@ -55,8 +55,15 @@ class MixologyBridge extends BridgeAbstract { $article = getSimpleHTMLDOMCached($item['uri']); - $item['author'] = $article->find('.beitrag-author a', 0)->plaintext; - $item['timestamp'] = strtotime($article->find('.beitrag-date time', 0)->datetime); + $authorLink = $article->find('.beitrag-author a', 0); + if (!empty($authorLink)) { + $item['author'] = $authorLink->plaintext; + } + + $timeElement = $article->find('.beitrag-date time', 0); + if (!empty($timeElement)) { + $item['timestamp'] = strtotime($timeElement->datetime); + } $content = '';