How To Check If Object Is Nonetype Python