Skip to content

Conversation

ByeongUkChoi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants