Avoid the dreaded "AttributeError: 'NoneType' object has no attribute
'endswith'" exception...

A.