Handle nil slash.
This commit is contained in:
+10
-3
@@ -448,9 +448,16 @@ module Gollum
|
|||||||
# is found.
|
# is found.
|
||||||
def find_page_from_name(cname)
|
def find_page_from_name(cname)
|
||||||
slash = cname.rindex('/')
|
slash = cname.rindex('/')
|
||||||
name = cname[slash+1..-1]
|
|
||||||
path = cname[0..slash]
|
unless slash.nil?
|
||||||
if page = @wiki.paged(name, path)
|
name = cname[slash+1..-1]
|
||||||
|
path = cname[0..slash]
|
||||||
|
page = @wiki.paged(name, path)
|
||||||
|
else
|
||||||
|
page = @wiki.page(cname)
|
||||||
|
end
|
||||||
|
|
||||||
|
if page
|
||||||
return page
|
return page
|
||||||
end
|
end
|
||||||
if pos = cname.index('#')
|
if pos = cname.index('#')
|
||||||
|
|||||||
Reference in New Issue
Block a user