Skip to content

Commit c0e45df

Browse files
ycdzjCopilot
andauthored
Update src/interceptor/user.interceptor.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fb3a085 commit c0e45df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interceptor/user.interceptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class UserInterceptor implements NestInterceptor {
3232
}
3333
} else if (ctxType === 'ws') {
3434
const client = executionContext.switchToWs().getClient<Socket>();
35-
userId = client.data.userId;
35+
userId = client.data?.userId ?? null;
3636
}
3737
return next.handle().pipe(
3838
tap((responseBody) => {

0 commit comments

Comments
 (0)