Changed null check to == from === to disallow undefined