(PUP-1547) Undefined method 'groups' for nil:NilClass when no providers found

Fix for https://tickets.puppetlabs.com/browse/PUP-1547