diff --git a/app/views/shared/_file_hljs.html.haml b/app/views/shared/_file_hljs.html.haml
index 166a13bd76c02553e50bde266fb323b69212948d..338236c0752704733d05098197574fedb6a3025b 100644
--- a/app/views/shared/_file_hljs.html.haml
+++ b/app/views/shared/_file_hljs.html.haml
@@ -1,6 +1,6 @@
%div.highlighted-data{class: user_color_scheme_class}
.line-numbers
- - blob.data.lines.size.times do |index|
+ - blob.data.lines.to_a.size.times do |index|
- offset = defined?(first_line_number) ? first_line_number : 1
- i = index + offset
= link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do