mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 18:22:58 +02:00
CODEBASE: Recheck all usages of typecasting with JSON.parse (#1775)
This commit is contained in:
@@ -40,6 +40,10 @@ export class Remote {
|
||||
}
|
||||
|
||||
function handleMessageEvent(this: WebSocket, e: MessageEvent): void {
|
||||
/**
|
||||
* Validating e.data and the result of JSON.parse() is too troublesome, so we typecast them here. If the data is
|
||||
* invalid, it means the RFA "client" (the tool that the player is using) is buggy, but that's not our problem.
|
||||
*/
|
||||
const msg = JSON.parse(e.data as string) as RFAMessage;
|
||||
|
||||
if (!msg.method || !RFARequestHandler[msg.method]) {
|
||||
|
||||
Reference in New Issue
Block a user