Procházet zdrojové kódy

Merge pull request #353 from pixelfed/frontend-ui-refactor

Update Status model
daniel před 7 roky
rodič
revize
9dba310f2f
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      app/Status.php

+ 3 - 0
app/Status.php

@@ -92,6 +92,9 @@ class Status extends Model
 
 
     public function bookmarked()
     public function bookmarked()
     {
     {
+      if(!Auth::check()) {
+        return 0;
+      }
       $profile = Auth::user()->profile;
       $profile = Auth::user()->profile;
       return Bookmark::whereProfileId($profile->id)->whereStatusId($this->id)->count();
       return Bookmark::whereProfileId($profile->id)->whereStatusId($this->id)->count();
     }
     }