I think this second `owner == NULL` check would be less confusing if moved in to the previous `owner == NULL` check.  It can never occur in the other case.