If gives error for no reason

I can’t use if statement which checks if value of entity variable is Undefined because it always gives me error

image

I don’t know where you found undefined value. I would suggest use the function entity exists to check.