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

Type error in onPortDisconnect function #2195

Closed
mneunomne opened this issue Oct 23, 2022 · 6 comments
Closed

Type error in onPortDisconnect function #2195

mneunomne opened this issue Oct 23, 2022 · 6 comments
Assignees
Labels

Comments

@mneunomne
Copy link
Collaborator

There is this minor bug occurring which I didn't find the reason for it yet, but I can't detect any consequences of it yet:

Error in event handler: TypeError: Cannot read properties of null (reading 'name')

onPortDisconnect: function(port) {
this.ports.delete(port.name);
},

@mneunomne mneunomne added the Bug label Oct 23, 2022
@mneunomne mneunomne self-assigned this Oct 23, 2022
@dhowe
Copy link
Owner

dhowe commented Oct 24, 2022

in any case, we should always be checking for undefined before accessing properties/functions

@mneunomne
Copy link
Collaborator Author

This is not AdNauseam code, so the issue is more like there is something in our code that is not adapted well to the way in which uBlock closes the ports.

@mneunomne
Copy link
Collaborator Author

It seems that this is just happening when opening the menu, and no issues seems to arise from that. I handled the exception with a message when debugging is enabled. I'll close once merged.

@mneunomne
Copy link
Collaborator Author

Closing

@mneunomne
Copy link
Collaborator Author

Finally found out why this was happening. Using the debugger was not helping so I just had to use many consolelog to eventually figure out it was a case switch with a break instead of a return in the getCostPerClick function implemented on #2162.

@mneunomne mneunomne mentioned this issue Aug 16, 2023
dhowe added a commit that referenced this issue Aug 17, 2023
@mneunomne
Copy link
Collaborator Author

Fixed, closing.

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

No branches or pull requests

2 participants