Skip to content

Conversation

@Manuel-Pol
Copy link
Collaborator

No description provided.

@Manuel-Pol Manuel-Pol self-assigned this May 24, 2025
const forwardingData = ViewNetworkDevice.getForwardingData(
this.id,
dstDevice.id,
dstDevice?.id,
Copy link
Owner

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.

Comment on lines +67 to +70
src = {
mac: srcDevice.interfaces[0].mac,
ip: srcDevice.interfaces[0].ip,
};
Copy link
Owner

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]?

Comment on lines +71 to +74
dst = {
mac: dstDevice.interfaces[0].mac,
ip: dstDevice.interfaces[0].ip,
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here:

Suggested change
dst = {
mac: dstDevice.interfaces[0].mac,
ip: dstDevice.interfaces[0].ip,
};
dst = dstDevice.interfaces[0];

@pgallino pgallino merged commit fac06e8 into main May 27, 2025
3 checks passed
@pgallino pgallino deleted the fix/handling-undefined-forwarding-data branch May 27, 2025 02:39
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.

4 participants