Prevent a NULL-pointer dereference in connect_to()