Skip to content

Commit

Permalink
adjusting comment request validation
Browse files Browse the repository at this point in the history
  • Loading branch information
levijackson committed Jun 30, 2021
1 parent 2532622 commit bfdb322
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/CommentRequest.php
Expand Up @@ -8,7 +8,7 @@ class CommentRequest extends FormRequest
{
public function authorize()
{
if ($this->user()->id > 0) {
if ($this->user() && $this->user()->id > 0) {
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/DeleteCommentRequest.php
Expand Up @@ -13,7 +13,7 @@ public function rules()

public function authorize()
{
if ($this->user()->canManagePosts()) {
if ($this->user() && $this->user()->canManagePosts()) {
return true;
}
return false;
Expand Down

0 comments on commit bfdb322

Please sign in to comment.