瀏覽代碼

Update Status model

Daniel Supernault 7 年之前
父節點
當前提交
4b0939cbfb
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/Status.php

+ 3 - 0
app/Status.php

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