Notice: Trying to get property of non-object
You didn't print line numbers of the second error so I don't know if they happen on then same line. Maybe your notice is from something else.

What you could try is to print out the variable using print_r, vardump, debug or use the Devel module which creates some wrapper functions like dpm to print variables with Krumo.

It should be impossible that the same variable is an object and isn't an object at the same time. But it's hard to say more with the info you provided.

Update:
From your comments, I can see why you are getting the errors:

print $user_profile-&gt;field_country['und']['0']['value'];


Error >> Notice: Undefined index: und ...

print $user_profile['field_country']['und']['0']['value'];


Fatal >> Cannot use object of type stdClass as array

The problem as I marked in the error message is that und is not defined in the field value. So $user_profile-&gt;field_country is ok but $user_profile-&gt;field_country['und'] is undefined. The reason could be that it doesn't have a value set or that the language for the field isn't undefined. You should like I suggested above, print out the variable to see what it contains.