-
Notifications
You must be signed in to change notification settings - Fork 0
fix: handles cases where the NetworkDevice.getForwardingData return undefined #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| const forwardingData = ViewNetworkDevice.getForwardingData( | ||
| this.id, | ||
| dstDevice.id, | ||
| dstDevice?.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an early return for this? The question mark here only avoids calling .id on the dstDevice, but it will still pass an undefined to getForwardingData.
| src = { | ||
| mac: srcDevice.interfaces[0].mac, | ||
| ip: srcDevice.interfaces[0].ip, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do src = srcDevice.interfaces[0]?
| dst = { | ||
| mac: dstDevice.interfaces[0].mac, | ||
| ip: dstDevice.interfaces[0].ip, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here:
| dst = { | |
| mac: dstDevice.interfaces[0].mac, | |
| ip: dstDevice.interfaces[0].ip, | |
| }; | |
| dst = dstDevice.interfaces[0]; |
No description provided.