Function to check for value prior to using getValue?
I think you are looking for the main property of the field:

if ($item = $user-&gt;get($fieldName)-&gt;first()) {
  $string = $item-&gt;{$item-&gt;mainPropertyName()};
}
else {
  $string = '';
}