lib/thinreports/report/base.rb in thinreports-0.8.1 vs lib/thinreports/report/base.rb in thinreports-0.8.2

- old
+ new

@@ -136,12 +136,12 @@ # @option options [Boolean] :count (true) # @yield [page] # @yieldparam [Thinreports::Report::Page] page # @return [Thinreports::Report::Page] def start_new_page(options = {}, &block) - unless layout = internal.load_layout(options.delete(:layout)) - raise Thinreports::Errors::NoRegisteredLayoutFound - end + layout = internal.load_layout(options.delete(:layout)) + + raise Thinreports::Errors::NoRegisteredLayoutFound unless layout page = internal.add_page(layout.new_page(self, options)) call_block_in(page, &block) end