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.
|
||
|---|---|---|
| .github | ||
| packages/node_modules | ||
| scripts | ||
| test | ||
| .gitattributes | ||
| .gitignore | ||
| .jshintrc | ||
| API.md | ||
| CHANGELOG.md | ||
| CITATION.cff | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Gruntfile.js | ||
| LICENSE | ||
| README.md | ||
| SECURITY.md | ||
| jsdoc.json | ||
| nodemon.json | ||
| package-lock.json | ||
| package.json | ||
README.md
Quick Start
Check out https://nodered.org/docs/getting-started/ for full instructions on getting started.
sudo npm install -g --unsafe-perm node-rednode-red- Open http://localhost:1880
[!NOTE] More documentation can be found here. For further help, or general discussion, please join the Node-RED Forum or Node-RED Slack.
Links
- Documentation ↗
- About ↗
- Installation ↗
- Node-RED Library ↗
- Development
- Contributing
- Copyright and license
Development
If you want to run the latest code from git, here's how to get started:
-
Clone the code:
git clone https://github.com/node-red/node-red.git cd node-red -
Install the node-red dependencies
npm ci -
Build the code
npm run build -
Run
npm start
Contributing
Before raising a pull-request, please read our contributing guide.
This project adheres to the Contributor Covenant 1.4. By participating, you are expected to uphold this code. Please report unacceptable behavior to any of the project's core team at team@nodered.org.
Star history
Contributors
It is maintained by:
- Nick O'Leary @knolleary
- Dave Conway-Jones @ceejay
- And many others:
Copyright and License
Node-RED is a project of the OpenJS Foundation. Copyright OpenJS Foundation and other contributors, https://openjsf.org under the Apache 2.0 license.
