Fix bad behavor while pinging Clients

fixes #6941
Check only `client != null` here.