ByeongUkChoi opened a new pull request, #183:
URL: https://github.com/apache/age-viewer/pull/183
#### **Summary**
This PR ensures that `nodes` and `edges` properties in `GraphCreator` are
always initialized as arrays, preventing potential `undefined` errors when
processing uploaded files.
#### **Changes**
- Updated `CypherController.js`:
- Set `nodes` and `edges` to default to empty arrays (`[]`) if
`req.files.nodes` or `req.files.edges` are `undefined`.
#### **Reason for Change**
- If `req.files.nodes` or `req.files.edges` is missing, `GraphCreator` would
receive `undefined`, potentially causing runtime errors during graph parsing.
- Defaulting these values to empty arrays ensures that downstream
operations, such as `map()` and `forEach()`, do not fail.
#### **Impact**
- Improves robustness when handling file uploads.
- Prevents potential crashes due to missing properties.
- Ensures `GraphCreator` always has valid `nodes` and `edges` arrays to work
with.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]