Add safe navigation for users without callout state

This commit is contained in:
Matija Čupić 2018-01-30 00:08:27 +01:00
parent 977996d2b3
commit 2cd71eb5f5
No known key found for this signature in database
GPG key ID: 4BAF84FFACD2E5DE

View file

@ -6,6 +6,6 @@ module CalloutsHelper
private
def user_dismissed?(feature_name)
Callout.find_by(user: current_user, feature_name: feature_name).dismissed_state?
Callout.find_by(user: current_user, feature_name: feature_name)&.dismissed_state?
end
end