fix error handling in case of network errors

in case of network errors the client will receive packets of type None.
commit 8d5c750 rewrote the sanity checks but this check was a no-op for
the client waiting for a packet of a specific type