65c65,70
< assert(in_msg_ptr != NULL); // Check the cast result
---
> if (in_msg_ptr == NULL) {
> // If the cast fails, this is the wrong inport (wrong message type).
> // Throw an exception, and the caller will decide to either try a
> // different inport or punt.
> throw RejectException();
> }