dont bomb when trying to find a page with a blank name

This commit is contained in:
rick
2010-09-12 20:04:21 -07:00
parent 42bd6c221a
commit e774ceaf1f
+2
View File
@@ -264,11 +264,13 @@ module Gollum
#
# Returns a Gollum::Page or nil if the page could not be found.
def find_page_in_tree(map, name, checked_dir = nil)
return nil if name.blank?
if checked_dir = BlobEntry.normalize_dir(checked_dir)
checked_dir.downcase!
end
map.each do |entry|
next if entry.name.blank?
next unless checked_dir.nil? || entry.dir.downcase == checked_dir
next unless page_match(name, entry.name)
return entry.page(@wiki, @version)