diff --git a/app/views/attachments/upload.js.erb b/app/views/attachments/upload.js.erb index ade73ab23..4761f4635 100644 --- a/app/views/attachments/upload.js.erb +++ b/app/views/attachments/upload.js.erb @@ -1,5 +1,5 @@ var fileSpan = $('#attachments_<%= j params[:attachment_id] %>'); -<% if @attachment.new_record? %> +<% if(!@attachment.nil? && @attachment.new_record?) %> fileSpan.hide(); alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>"); <% else %>