I am not familiar with this code, but can this ever be None? I'm wondering whether an exception could ever be triggered by the next if statement.