TypeError should be used to catch NoneType