(#12960) Fix puppet resource <type> if type has no providers
puppet resource type calls the instances method of the type class. The
instances method then calls providers_by_source which can fail if the
following conditions are true
- there is at least one provider defined for the type
- all providers are unsuitable
If both requirements are met, the method self.defaultprovider will
return nil and we get the following error message (provided by Ben Ford)
- puppet resource maillist puppet/type.rb:902:in providers_by_source': undefined method source' for nil:NilClass (NoMethodError)
The fix handles the case where defaultprovider can be nil