( $5 == $null ) is the same as ( $5 == 0 ) - write a test script and try it. Test

if %test { }

for %test equal to $null, 0 and 1. You'll get the same result if it's $null or 0 - they're both false. 1 (or any non-zero, non-$null value) is true.