correct exception when page is sent in as array

This commit is contained in:
Sam 2015-05-07 10:49:29 +10:00
parent d6c06eb547
commit 4167757dee
1 changed files with 3 additions and 1 deletions

View File

@ -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