Skip to content

Commit f8316ba

Browse files
committed
Fix checking of userId on amplitude
1 parent a7b39c8 commit f8316ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/common/src/utils/analytics/amplitude.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export const resetUserId = () => {
4444
debug('[Amplitude] Resetting User ID');
4545
identify('userId', null);
4646

47-
if (global.amplitude.getInstance().options.userId) {
47+
if (
48+
global.amplitude.getInstance().options &&
49+
global.amplitude.getInstance().options.userId
50+
) {
4851
global.amplitude.getInstance().setUserId(null);
4952
global.amplitude.getInstance().regenerateDeviceId();
5053
}

0 commit comments

Comments
 (0)