NoMethodError in ArticlesController#show

undefined method `user_id' for nil:NilClass

Extracted source (around line #17):
15
16
17
18
19
20
              
@article = Article.find_by(slug: params[:id])
@host = "https://www.therightdivorcesolution.com"
author_id = @article.user_id
@author = User.where(id: author_id).first
end

Rails.root: /home/scottkekoa/apps/therightdivorce/myproject

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"id"=>"former-spouse-military-medical-benefits"}

Response

Headers:

None