From c31d676f0f20425663bbd8b3c63f8e5820b7e478 Mon Sep 17 00:00:00 2001 From: Jack Danger Canty Date: Wed, 10 Dec 2008 12:02:02 -0800 Subject: [PATCH] skipping related_posts when there is only one post. Without this the Matrix class raises an error trying to coerce nil into a Matrix. --- lib/jekyll/post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index e570baaff0e..c227e3180d1 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -96,6 +96,7 @@ def id # # Returns [] def related_posts(posts) + return [] unless posts.size > 1 self.class.lsi ||= begin puts "Running the classifier... this could take a while." lsi = Classifier::LSI.new @@ -145,4 +146,4 @@ def to_liquid end end -end \ No newline at end of file +end