From edcfdfa402aa0916a77cd60d8faa3bf941be8aeb Mon Sep 17 00:00:00 2001 From: rick Date: Fri, 13 Aug 2010 16:10:59 -0700 Subject: [PATCH] return nil for bad file version --- lib/gollum/file.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/gollum/file.rb b/lib/gollum/file.rb index c1999fe6..2f2b41e7 100644 --- a/lib/gollum/file.rb +++ b/lib/gollum/file.rb @@ -46,14 +46,13 @@ module Gollum # # Returns a Gollum::File or nil if the file could not be found. def find(name, version) - commit = @wiki.repo.commit(version) - if blob = commit.tree / name - @blob = blob - @path = name - @version = commit - self - else - nil + if commit = @wiki.repo.commit(version) + if blob = commit.tree / name + @blob = blob + @path = name + @version = commit + self + end end end end