dont bomb when trying to find a page with a blank name
This commit is contained in:
@@ -264,11 +264,13 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns a Gollum::Page or nil if the page could not be found.
|
# Returns a Gollum::Page or nil if the page could not be found.
|
||||||
def find_page_in_tree(map, name, checked_dir = nil)
|
def find_page_in_tree(map, name, checked_dir = nil)
|
||||||
|
return nil if name.blank?
|
||||||
if checked_dir = BlobEntry.normalize_dir(checked_dir)
|
if checked_dir = BlobEntry.normalize_dir(checked_dir)
|
||||||
checked_dir.downcase!
|
checked_dir.downcase!
|
||||||
end
|
end
|
||||||
|
|
||||||
map.each do |entry|
|
map.each do |entry|
|
||||||
|
next if entry.name.blank?
|
||||||
next unless checked_dir.nil? || entry.dir.downcase == checked_dir
|
next unless checked_dir.nil? || entry.dir.downcase == checked_dir
|
||||||
next unless page_match(name, entry.name)
|
next unless page_match(name, entry.name)
|
||||||
return entry.page(@wiki, @version)
|
return entry.page(@wiki, @version)
|
||||||
|
|||||||
Reference in New Issue
Block a user