Permalink
Browse files

Fix bug when no action callback was defined

  • Loading branch information...
1 parent 27aa27c commit e3c64c52961301c3c348553bc7d2c1ccaaa23d88 @mneumann committed Jan 4, 2010
Showing with 5 additions and 1 deletion.
  1. +4 −0 lib/wee/callback.rb
  2. +1 −1 lib/wee/session.rb
View
@@ -9,6 +9,10 @@ def initialize(prefix="")
@obj_map = {} # obj => [callback_id1, callback_id2, ...]
end
+ def empty?
+ @callbacks.empty?
+ end
+
def register(object, callback)
id = @next_id
@next_id += 1
View
@@ -307,7 +307,7 @@ def action(request, page)
end
if action_callback
action_callback.call
- else
+ elsif not page.callbacks.action_callbacks.empty?
#
# An action request with an action-id without a corresponding
# registered action callback is considered an invalid request.

0 comments on commit e3c64c5

Please sign in to comment.