diff --git a/lib/sinatra/flash.rb b/lib/sinatra/flash.rb index 07b07ff..371d4ca 100644 --- a/lib/sinatra/flash.rb +++ b/lib/sinatra/flash.rb @@ -12,10 +12,10 @@ def self.registered(app) # This callback rotates any flash structure we referenced, placing the 'next' hash into the session # for the next request. - app.after {@flash.each{|key, flash| session[key] = @flash[key].next} if @flash} + app.after {@flash.each{|key, flash| session[key] = @flash[key].next} if defined? @flash} end end register Flash -end \ No newline at end of file +end