Only dispose client and only if it's not null.