diff --git a/app/views/search/_project_results.html.haml b/app/views/search/_project_results.html.haml
index 751824dce4a0f0e502c86acbff21f781016a211c..5e8346a8262e331693deda5b175e68deea89bd7b 100644
--- a/app/views/search/_project_results.html.haml
+++ b/app/views/search/_project_results.html.haml
@@ -15,10 +15,10 @@
       - else
         = render partial: "search/results/empty", :locals => { message: "We couldn't find any matching code" }
   - else
-    - if (@search_results[:merge_requests] || @search_results[:issues] || @search_results[:notes]).length > 0
+    - if @search_results[:merge_requests].present? || @search_results[:issues].present? || @search_results[:notes].present?
       %ul.bordered-list
         = render partial: "search/results/merge_request", collection: @search_results[:merge_requests]
         = render partial: "search/results/issue", collection: @search_results[:issues]
         = render partial: "search/results/note", collection: @search_results[:notes]
     - else
-      = render partial: "search/results/empty", :locals => { message: "We couldn't find any issues, merge requests or notes" }
+      = render partial: "search/results/empty", locals: { message: "We couldn't find any issues, merge requests or notes" }