diff --git a/src/Supports/Domain.php b/src/Supports/Domain.php index 644df84..7e25902 100644 --- a/src/Supports/Domain.php +++ b/src/Supports/Domain.php @@ -21,10 +21,14 @@ public static function getDomainInfo($url) $favicon = ShortUrlFavicon::where('domain', $data['host'])->first(); if (!$favicon) { - $favicon = ShortUrlFavicon::create([ - 'domain' => $data['host'], - 'favicon' => (new Favicon())->getFavicon($data['host']), - ]); + $crawledFavicon = (new Favicon())->getFavicon($data['host']); + + if ($crawledFavicon) { + $favicon = ShortUrlFavicon::create([ + 'domain' => $data['host'], + 'favicon' => $crawledFavicon, + ]); + } } $data['favicon_id'] = $favicon->id ?? null;