Let's properly check if all the required fields are set

We would probably crash if we try to connect with address NULL on port 0.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>