Don't call id on nil

This commit is contained in:
Joshua Peek
2011-09-27 13:48:16 -05:00
parent 39b1177ba0
commit 985fade9f6
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ module Gollum
@wiki = page.wiki
@name = page.filename
@data = page.text_data
@version = page.version.id
@version = page.version.id if page.version
@format = page.format
@dir = ::File.dirname(page.path)
@tagmap = {}
+1
View File
@@ -381,6 +381,7 @@ module Gollum
#
# Returns the Page or nil if none exists.
def find_sub_page(name)
return nil unless self.version
return nil if self.filename =~ /^_/
name = "_#{name.to_s.capitalize}"
return nil if page_match(name, self.filename)