Commit 75db8b69 authored by Tobias Schmidt's avatar Tobias Schmidt

Fix nil comparision

parent 8beb0328
...@@ -103,7 +103,7 @@ module Versioned ...@@ -103,7 +103,7 @@ module Versioned
# TODO(ts): Refactor and think about linking directly to the page of the same version. # TODO(ts): Refactor and think about linking directly to the page of the same version.
first = items first = items
.find { |i| i.path.start_with?(v[:items_root]) } .find { |i| i.path.start_with?(v[:items_root]) }
.children.sort_by { |c| c[:sort_rank] }.first .children.sort_by { |c| c[:sort_rank] || 0 }.first
%(<option value="#{first.path}" #{selected}>#{v[:name]}</option>) %(<option value="#{first.path}" #{selected}>#{v[:name]}</option>)
end end
classes = active ? 'active' : '' classes = active ? 'active' : ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment