Check for None before assignment
Check for None before assignment

Ref https://sentry.io/organizations/read-the-docs/issues/1482635921/?project=148442&query=is%3Aunresolved

rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org