We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8623caa commit a1b61b4Copy full SHA for a1b61b4
app/controllers/bootcamp_controller.rb
@@ -122,9 +122,11 @@ def setup_data!
122
session[:country_code_2] = @country_code_2
123
end
124
125
- return unless @bootcamp_data.user_id.nil? && cookies.signed[:_exercism_user_id].present?
126
-
127
- @bootcamp_data.update(user_id: cookies.signed[:_exercism_user_id])
+ # rubocop:disable Style/SafeNavigation
+ if @bootcamp_data && @bootcamp_data.user_id&.nil? && cookies.signed[:_exercism_user_id].present? # rubocop:disable Style/GuardClause
+ @bootcamp_data.update(user_id: cookies.signed[:_exercism_user_id])
128
+ end
129
+ # rubocop:enable Style/SafeNavigation
130
131
132
def retrieve_user_bootcamp_data_from_user
0 commit comments