Bug 1635054 - stop using ?. operator in newtab download manager code, r=aryx

Differential Revision: https://phabricator.services.mozilla.com/D73623
This commit is contained in:
Gijs Kruitbosch 2020-05-04 12:12:21 +00:00
parent 595db05652
commit d2b64e9c45

View File

@ -36,7 +36,9 @@ this.DownloadsManager = class DownloadsManager {
}
formatDownload(download) {
let referrer = download.source.referrerInfo?.originalReferrer?.spec || null;
let { referrerInfo } = download.source;
let referrer = (referrerInfo && referrerInfo.originalReferrer) || null;
referrer = (referrer && referrer.spec) || null;
return {
hostname: new URL(download.source.url).hostname,
url: download.source.url,