Don't try to connect if connection is null