Resolve "Error 500 viewing notes with anonymous user"
What does this MR do?
When a group has a pending email invite for an owner or master, with no associated user ID, we'd consider the anonymous user an owner.
- Don't do that.
- Add a bit of extra safety to the methods on Group.
Are there points in the code the reviewer needs to double check?
I couldn't find an existing scope for this, so I just added where.not(user_id: nil).
Does this MR meet the acceptance criteria?
- 
Changelog entry added, if necessary 
- Tests
- 
Added for this feature/bug 
- 
All builds are passing 
 
- 
- 
Conform by the merge request performance guides 
- 
Conform by the style guides 
- 
Branch has no merge conflicts with master(if it does - rebase it please)
- 
Squashed related commits together 
What are the relevant issue numbers?
Closes #35444 (closed).
Edited  by Sean McGivern