Skip to content

Commit

Permalink
Fix edit code error in landing page.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfisher committed Nov 11, 2020
1 parent 3943b9a commit df32461
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def ajax_blocked

def valid_edit_code?
edit_code = params[:edit_code] || session[:edit_code]
if resource && (edit_code == resource.identifier.edit_code)
if defined?(resource) && resource.present? && (edit_code == resource.identifier.edit_code)
# Code is valid, so save it in the session for later use (and implicitly return true)
session[:edit_code] = edit_code
else
Expand Down

0 comments on commit df32461

Please sign in to comment.