if Object1 or Object2 == Object3
IS NOT THE SAME AS
if Object1 == Object3 or Object2 == Object3
objects in an if statement in the end should evaluate to a boolean, usually if the item is null it is false and true if otherwise, what you did is basically saying
if (Object1 != null) or (Object2 == Object3)
while object1 is not null, you wont be able to do anything
**just a side note use return instead of pass, as pass is just a placeholder and wont block anything(if im not mistaken) while return works like in any other language and exit the code block and goes back to the previous one