Fix NoMethodError for track event method
What does this MR do and why?
- Contributes to #436951 (closed)
- Sentry error: https://new-sentry.gitlab.net/organizations/gitlab/issues/481453
Problem
context.user
can be missing, but the code doesn't handle this case.
Solution
Explicitly verify that User
object is present.