aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2012-11-10 01:13:49 +0100
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2012-11-10 01:40:02 +0100
commitb6915e9452f6650c3bb95169c317d24f136ea46e (patch)
tree9dd36bbe7d90c438f20c6754b5059f1e5bc1662a /app
parentec152ba7b4ca29bd7109352f013f38ad4f12f3d2 (diff)
downloadecs2-b6915e9452f6650c3bb95169c317d24f136ea46e.tar.gz
ecs2-b6915e9452f6650c3bb95169c317d24f136ea46e.zip
Fix postrouting exception.
When creating new participants and then postrouting messages i forgot to check if rec_mids was empty. If so this means the message in question must not be postrouted. Otherwise there will be thrown an Ecs::MissingReceiverHeaderException exception and all further possibly necessary postroutings will stop.
Diffstat (limited to 'app')
-rw-r--r--app/models/ressource.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/ressource.rb b/app/models/ressource.rb
index c696c48..4730d9b 100644
--- a/app/models/ressource.rb
+++ b/app/models/ressource.rb
@@ -35,11 +35,12 @@ class Ressource < ActiveRecord::Base
rec_mids << memb.id
end
end
- begin
- MembershipMessage.populate_jointable(msg, rec_mids.join(',') , nil, Participant.find(msg.sender))
- Event.make(:event_type_name => EvType.find(1).name, :participant => participant, :message => msg)
- rescue Ecs::InvalidMessageException, Ecs::AuthorizationException
- rescue Ecs::InvalidMessageException
+ unless rec_mids.empty?
+ begin
+ MembershipMessage.populate_jointable(msg, rec_mids.join(',') , nil, Participant.find(msg.sender))
+ Event.make(:event_type_name => EvType.find(1).name, :participant => participant, :message => msg)
+ rescue Ecs::InvalidMessageException, Ecs::AuthorizationException
+ end
end
end
end