If else not working?

Cause it didn’t return any object.
so you must check the @oLogin first.