Don't throw an exception if the client has no delivery hook.

This commit is contained in:
akwizgran
2016-09-16 22:02:04 +01:00
parent cc439aa74f
commit 16ac73d002

View File

@@ -339,9 +339,9 @@ class ValidationManagerImpl implements ValidationManager, Service,
private boolean deliverMessage(Transaction txn, Message m, ClientId c,
Metadata meta) throws DbException {
// Deliver the message to the client if it's registered a hook
IncomingMessageHook hook = hooks.get(c);
if (hook == null) throw new DbException();
hook.incomingMessage(txn, m, meta);
if (hook != null) hook.incomingMessage(txn, m, meta);
// TODO: Find a better way for clients to signal validity, #643
if (db.getRawMessage(txn, m.getId()) == null) {
db.setMessageState(txn, m.getId(), INVALID);