if ($1 == $null) {
and
if ($1) {

are not the same. If $1 is set to 0 or $false, the first statement will be $true, whereas the second statement will be $false.

-genius_at_work