Fix gsub for NilClass issue at vmware compute resource / compute profile

There are 2 issues describing the same issue:
https://projects.theforeman.org/issues/28155
https://projects.theforeman.org/issues/30550

A possible solution is described in the last comment of the first ticket:

I guess Foreman works in our case without that gsub-method, because we do not deploy VMs in subfolders inside die vSphere ressource-pool/cluster. So I would take this code-modification as “workaround”.

It “matches” with the described solution of the second issue to add a “to_s” which would result in a empty string result ("")

What are your thoughts? Should we go with the second solution to add a to_s?

Adding to_s sounds like quite simple solution.
Adding the safe navigation operator (&.) would also work.

Can you please send a patch? I’ll merge that right away and we can get the fix in 3.1.1

https://github.com/theforeman/foreman/pull/9006

Safe operator is fine.