Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug when no action callback was defined

  • Loading branch information...
commit e3c64c52961301c3c348553bc7d2c1ccaaa23d88 1 parent 27aa27c
@mneumann authored
Showing with 5 additions and 1 deletion.
  1. +4 −0 lib/wee/callback.rb
  2. +1 −1  lib/wee/session.rb
View
4 lib/wee/callback.rb
@@ -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
2  lib/wee/session.rb
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.