Skip to content

Commit 49dcb1a

Browse files
committed
fixed issue with null token
1 parent b7756c3 commit 49dcb1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controllers/headache_logs_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def headache_log_params
7878
end
7979

8080
def set_share_link
81-
@share_link = shared_logs_url(token: current_user.share_tokens.last.token)
81+
if last_token = current_user.share_tokens.last
82+
@share_link = shared_logs_url(token: last_token.token)
83+
end
8284
end
8385

8486
def apply_filters

0 commit comments

Comments
 (0)