Merge pull request #5064 from overleaf/ab-analytics-smoke-check

Add null check for smoke test user in analytics manager

GitOrigin-RevId: 2ece12f1a674943577ecee272435df535225ec9e
This commit is contained in:
Alexandre Bourdin 2021-09-10 15:20:49 +02:00 committed by Copybot
parent 3577f25ba2
commit dd018be499

View file

@ -178,7 +178,11 @@ function _setUserProperty({ analyticsId, propertyName, propertyValue }) {
function _isSmokeTestUser(userId) {
const smokeTestUserId = Settings.smokeTest && Settings.smokeTest.userId
return smokeTestUserId != null && userId.toString() === smokeTestUserId
return (
smokeTestUserId != null &&
userId != null &&
userId.toString() === smokeTestUserId
)
}
function _isAnalyticsDisabled() {