mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1444132 - Always wait for full Connector setup in getHarExportConnector. r=jdescottes
MozReview-Commit-ID: 2k18TK78fk8 --HG-- extra : rebase_source : 4bbe481d3724dc7bb3e26eb79bfa8351c22bcf32
This commit is contained in:
parent
d41a01a8c9
commit
2b5681f94c
@ -178,6 +178,9 @@ NetMonitorAPI.prototype = {
|
||||
*/
|
||||
async getHarExportConnector() {
|
||||
if (this.harExportConnector) {
|
||||
// Ensure waiting for connectBackend completion to prevent "this.connector is null"
|
||||
// exceptions if getHarExportConnector is called twice during its initialization.
|
||||
await this.harExportConnectorReady;
|
||||
return this.harExportConnector;
|
||||
}
|
||||
|
||||
@ -189,7 +192,9 @@ NetMonitorAPI.prototype = {
|
||||
};
|
||||
|
||||
this.harExportConnector = new Connector();
|
||||
await this.connectBackend(this.harExportConnector, connection);
|
||||
this.harExportConnectorReady =
|
||||
this.connectBackend(this.harExportConnector, connection);
|
||||
await this.harExportConnectorReady;
|
||||
return this.harExportConnector;
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user