Expression XOR Null

I'm using xor in an expression binding and it's throwing an error that xor can't handle

null xor null

Shouldn't this just evaluate to false? I can wrap it in a try() to get rid of the error until those values are non-null, but this just seems like odd behavior, considering || and && can handle null just fine.

xor is bitwise, like | and &, not boolean like || and &&. Consider using coalesce() to convert nulls to zero. Also, if you are trying to get true boolean xor, you will need to ensure your true values are really integer 1 to avoid unexpected results. 1 xor 3 yields 2, not false.

5 Likes