Handle nil slash.

This commit is contained in:
bootstraponline
2012-08-23 12:30:08 -06:00
parent 01fa4770cb
commit 33ca329253
+10 -3
View File
@@ -448,9 +448,16 @@ module Gollum
# is found.
def find_page_from_name(cname)
slash = cname.rindex('/')
name = cname[slash+1..-1]
path = cname[0..slash]
if page = @wiki.paged(name, path)
unless slash.nil?
name = cname[slash+1..-1]
path = cname[0..slash]
page = @wiki.paged(name, path)
else
page = @wiki.page(cname)
end
if page
return page
end
if pos = cname.index('#')