summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index ba418118f..fc56d9d6b 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -104,9 +104,11 @@ class WikiPage < ActiveRecord::Base
end
def content_for_version(version=nil)
- result = content.versions.find_by_version(version.to_i) if version
- result ||= content
- result
+ if content
+ result = content.versions.find_by_version(version.to_i) if version
+ result ||= content
+ result
+ end
end
def diff(version_to=nil, version_from=nil)