From 4167757dee7814df254d408d539e82630136708a Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 7 May 2015 10:49:29 +1000 Subject: [PATCH] correct exception when page is sent in as array --- lib/topic_view.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/topic_view.rb b/lib/topic_view.rb index 2fe19b75610..c4e23aef6bf 100644 --- a/lib/topic_view.rb +++ b/lib/topic_view.rb @@ -38,7 +38,9 @@ class TopicView self.instance_variable_set("@#{key}".to_sym, value) end - @page = @page.to_i + # work around people somehow sending in arrays, + # arrays are not supported + @page = @page.to_i rescue 1 @page = 1 if @page.zero? @chunk_size = options[:slow_platform] ? TopicView.slow_chunk_size : TopicView.chunk_size @limit ||= @chunk_size