https://tutorial.eyehunts.com/python/how-to-check-nonetype-in-python/
How to check NoneType in Python