Check for null instead of None

Fixes #522