var x = null
if x == null:
print('prediction 1: x is null')
if typeof(x) == TYPE_NIL:
print('prediction 2: x is null')
print(typeof(x), ' == ', TYPE_NIL)
results:
prediction 1: x is null
prediction 2: x is null
0 == 0
both, typeof with its variant types and null check look valid.
maybe you can add code tags to your questions, maybe there is an intendation error which could explain the not working continue