Get occurrences for 'this' keywords

When would there not be a parent? I guess only if you called isWriteAccess on a SourceFile. I feel like this check shouldn't be necessary.