mirror of https://github.com/node-red/node-red.git
Added try-catch blocks and null checks to event handlers in core nodes
to prevent uncaught exceptions from crashing the Node-RED runtime.
Changes per node:
**TCP (31-tcpin.js)**
- Wrapped all `on('data')` handlers in try-catch (TcpIn client/server, TcpGet)
**UDP (32-udp.js)**
- Wrapped `on('message')` handler in try-catch
**Exec (90-exec.js)**
- Wrapped stdout/stderr `on('data')` handlers in try-catch
**WebSocket (22-websocket.js)**
- Wrapped send() loop in handleEvent() with try-catch
**MQTT (10-mqtt.js)**
- Added null check for packet parameter in subscriptionHandler()
- Wrapped subscription handler callback in try-catch
- Added null check for mpacket.properties
Without these protections, malformed data or unexpected errors in async
event handlers could cause uncaught exceptions that crash the entire
Node-RED process.
|
||
|---|---|---|
| .. | ||
| @node-red | ||
| node-red | ||