Check for not null on cluster when running autodiscovery

it fails during the initialization and it is never able
to set the cluster object properly remaining as null for
future runs.