Permalink
Browse files

Only set parentpage if a subpage was found

Fixes error if there's no header or footer
  • Loading branch information...
1 parent 97dd1b3 commit 5f5187e05cbbb66b05a40eff1c062337323da84c @kristi kristi committed May 22, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/gollum/page.rb
View
5 lib/gollum/page.rb
@@ -435,8 +435,9 @@ def find_sub_page(name)
dirs.pop
end
- page = find_page_in_tree(map, name, '')
- page.parent_page = self
+ if page = find_page_in_tree(map, name, '')
+ page.parent_page = self
+ end
page
end

0 comments on commit 5f5187e

Please sign in to comment.