Ignore messages from unknown channels.

It occasionally happens that messages on a channel are received before
the subscription confirmation, which would cause a panic when looking
for the subscription.

Changed to simply ignore those.
This commit is contained in:
Paul Lietar 2016-01-02 15:50:43 +01:00
parent cf57274f9c
commit 5464647164

View file

@ -147,8 +147,8 @@ impl MercuryManager {
MercuryCallback::Subscription(tx) => self.complete_subscription(response, tx),
MercuryCallback::Channel => {
self.subscriptions
.get(header.get_uri()).unwrap()
.send(response).unwrap()
.get(header.get_uri())
.map(|tx| tx.send(response).unwrap());
}
}
}