Opened on 02/13/2018 at 02:41:42 PM
Closed on 02/13/2018 at 03:05:16 PM
Last modified on 02/13/2018 at 03:27:58 PM
#6384 closed defect (duplicate)
Undefined response object causing errors
Reported by: | agiammarchi | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Platform | Keywords: | |
Cc: | kzar | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Environment
I am using Adblock Plus for Firefox from hg as development extension.
How to reproduce
- debug the extension
- open any site with ads
- see error response is undefined include.preload.js:682
...
Observed behaviour
The include.preload.js code after browser.runtime.sendMessage({type: "elemhide.getSelectors"}, response => assumes there is always a response object.
If that is expected, there is some issue because some call won't pass an object, but undefined instead.
If that's not expected, there should be a guard against response != null or similar before checking its properties.
Expected behaviour
No error in the extension debugger console.
Attachments (0)
Change History (4)
comment:1 Changed on 02/13/2018 at 03:05:16 PM by kzar
- Resolution set to duplicate
- Status changed from new to closed
comment:2 Changed on 02/13/2018 at 03:14:58 PM by agiammarchi
6385 wasn't there when I've created this one but thanks for adding me in CC, that's surely a better ticket than this one.
comment:3 Changed on 02/13/2018 at 03:19:23 PM by kzar
Yea we created the issues at about the same time, well you can see from the numbers that yours was first! FWIW I would have marked my issue as a duplicate of yours if I had not already investigated the problem and came up with a fix.
comment:4 Changed on 02/13/2018 at 03:27:58 PM by agiammarchi
Absolutely! I was just trying to say that I did search before opening the ticket but you did a better job describing the issue later on.
Happy to know there's a fix already
This is a duplicate of #6385.