ignore Close() if connection is nil