diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb
index 998766b27..d1cdf8cc9 100644
--- a/app/views/attachments/_form_project.html.erb
+++ b/app/views/attachments/_form_project.html.erb
@@ -125,9 +125,9 @@
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
- <% if container.nil? %>
- <%= l(:label_no_file_uploaded)%>
- <% end %>
+ <% if defined?(container) %>
+ <%= l(:label_no_file_uploaded)%>
+ <% end %>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)