It would probably be dire circumstances in which `socketsPerStream[stream]` is not defined in this context, but it might safer to use `_.isEmpty(socketsPerStream[stream])` to avoid an invalid reference.