Skip to content

[Crash] Unchecked this.room.censor.detect in chat message handler #53

@coderabbitai

Description

@coderabbitai

Summary

Game server crashes when this.room.censor is undefined during chat.

Affected Code

server-game/src/client.js:346

} else if (!this.room.censor.detect(text, true)) {
  // CRASH if this.room.censor is undefined

Vulnerability

If room initialization incomplete or during shutdown.

Impact

  • Game server crash on chat
  • Denial of service

Recommended Fix

} else if (!this.room.censor?.detect(text, true)) {

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions