Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#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

  1. debug the extension
  2. open any site with ads
  3. 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.

Change History (4)

comment:1 Changed 21 months ago by kzar

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #6385.

comment:2 Changed 21 months ago 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 21 months ago 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 21 months ago 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

Note: See TracTickets for help on using tickets.