tiny bugfix to avoid trying to check a property on a null