summaryrefslogtreecommitdiffstats
path: root/lib/Db/Feed.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Db/Feed.php')
-rw-r--r--lib/Db/Feed.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Db/Feed.php b/lib/Db/Feed.php
index 3c371087b..5821466a5 100644
--- a/lib/Db/Feed.php
+++ b/lib/Db/Feed.php
@@ -326,13 +326,16 @@ class Feed extends Entity implements IAPI, \JsonSerializable
'basicAuthPassword'
]);
+ if (is_null($this->link)) {
+ return $serialized;
+ }
+
$url = parse_url($this->link, PHP_URL_HOST);
// strip leading www. to avoid css class confusion
if (strpos($url, 'www.') === 0) {
$url = substr($url, 4);
}
-
$serialized['cssClass'] = 'custom-' . str_replace('.', '-', $url);
return $serialized;
@@ -488,6 +491,9 @@ class Feed extends Entity implements IAPI, \JsonSerializable
*/
public function setLink(?string $link = null): Feed
{
+ if (is_null($link)) {
+ return $this;
+ }
$link = trim($link);
if (strpos($link, 'http') === 0 && $this->link !== $link) {
$this->link = $link;