Skip to content

Commit

Permalink
Prevent exception in repositories breadcrumb
Browse files Browse the repository at this point in the history
project_repository_state_path needs a repository defined in order to find
the right route. When the breadcrumb is used in an view where
no repository is set, it will throw an exception. For example in
the add repository view, which will be added soonish.
  • Loading branch information
krauselukas committed Dec 5, 2018
1 parent 16542be commit 0099652
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- if current_page?(repositories_path)
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Repositories
- elsif current_page?(project_repository_state_path)
- elsif defined?(@repository) && current_page?(project_repository_state_path)
%li.breadcrumb-item
= link_to 'Repositories', repositories_path
%li.breadcrumb-item.active{ 'aria-current' => 'page' }
Expand Down

0 comments on commit 0099652

Please sign in to comment.