Check If Object Is Nonetype Python