Skip to content
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

Fix CI failure on master and bug Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget #838

Merged
merged 2 commits into from
Jun 4, 2021

Conversation

vadimshvetsov
Copy link
Contributor

@vadimshvetsov vadimshvetsov commented Apr 27, 2021

Checklist

  • The code has been run through pretty yarn run pretty
  • The tests pass on CircleCI
  • You have referenced the issue(s) or other PR(s) this fixes/relates-to
  • The PR Template has been filled out (see below)
  • Had a beer/coffee because you are awesome

What?

We've got an error Uncaught TypeError: Cannot read property 'reportedPosition' of null at DefaultLinkModel.setSourcePort when we use link.clearPort(port)

Why?

Because we call then link.setSourcePort(null) or link.setTargetPort(null) to remove port from link.



But this methods doesn't check port existence before using reportPosition property.

How?

At first we need to expect null as input there for type safety. Then we would check port existence before using it's property

Feel good image:

LOL

@vadimshvetsov vadimshvetsov changed the title Fix set port Fix for Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Apr 27, 2021
@vadimshvetsov vadimshvetsov changed the title Fix for Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Fix Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Apr 27, 2021
@vadimshvetsov vadimshvetsov changed the title Fix Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Fix CI and bug Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Apr 27, 2021
@vadimshvetsov vadimshvetsov changed the title Fix CI and bug Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Fix CI failure on master and bug Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget Apr 27, 2021
@apatole
Copy link

apatole commented May 14, 2021

Is this fix now part of any public release? I am also seeing it and just want to see if upgrading to any new version will fix it? Thanks.

@vadimshvetsov
Copy link
Contributor Author

vadimshvetsov commented May 17, 2021

@apatole at this moment this is not a part of any public release. We are waiting for @dylanvorster capacity for checking this out.

@apatole
Copy link

apatole commented May 17, 2021

@vadimshvetsov Thank you for the updates.

@dylanvorster dylanvorster merged commit abadce1 into projectstorm:master Jun 4, 2021
@vadimshvetsov vadimshvetsov deleted the fix-set-port branch June 23, 2021 09:14
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.

3 participants