I tried to call .split() on a variable that was None.
username = None
parts = username.split("_")
print(parts)AttributeError: 'NoneType' object has no attribute 'split'
username = None
if username is None:
print("Username not available")
username = ""
parts = username.split("_")
print(parts)Forgot to check for None before calling a method.