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.
|
||
|---|---|---|
| .. | ||
| core | ||
| examples | ||
| icons | ||
| locales | ||
| .npmignore | ||
| 99-sample.html.demo | ||
| 99-sample.js.demo | ||
| LICENSE | ||
| README.md | ||
| index.js | ||
| package.json | ||
README.md
@node-red/nodes
Node-RED core nodes module.
This provides all of the core Node-RED nodes.
Source
The main Node-RED modules are maintained as a monorepo on GitHub.