Skip to content

Commit

Permalink
Add nil guard to generate_namespaces_breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
unasuke committed Nov 25, 2024
1 parent 31996c5 commit 71ee189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ def namespaces_to_class_modules klass

def generate_namespaces_breadcrumb klass, rel_prefix
namespaces_to_class_modules(klass).map do |namespace, class_module|
{ name: namespace, path: (rel_prefix + class_module.path).to_s, self: klass.full_name == class_module.full_name }
path = class_module ? (rel_prefix + class_module.path).to_s : ""
{ name: namespace, path: path, self: klass.full_name == class_module&.full_name }
end
end
end

0 comments on commit 71ee189

Please sign in to comment.