Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Bug #13891: Avoid 'circuitStatuses is undefined' error
Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions .
+11
−6
src/chrome/content/tor-circuit-display.js
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -54,9 +54,11 @@ let trimQuotes = s => s ? s.match(/^\"(.*)\"$/)[1] : undefined;
// is not currently used as a bridge, returns null.
let getBridge = function * ( controller , id ) {
let bridges = yield controller . getConf ( "bridge" ) ;
for ( let bridge of bridges ) {
if ( bridge . ID && bridge . ID . toUpperCase ( ) === id . toUpperCase ( ) ) {
return bridge ;
if ( bridges ) {
for ( let bridge of bridges ) {
if ( bridge . ID && bridge . ID . toUpperCase ( ) === id . toUpperCase ( ) ) {
return bridge ;
}
}
}
return null ;
@@ -107,11 +109,14 @@ let nodeDataForCircuit = function* (controller, circuitEvent) {
// Returns the circuit status for the circuit with the given ID.
let getCircuitStatusByID = function * ( aController , circuitID ) {
let circuitStatuses = yield aController . getInfo ( "circuit-status" ) ;
for ( let circuitStatus of circuitStatuses ) {
if ( circuitStatus . id === circuitID ) {
return circuitStatus ;
if ( circuitStatuses ) {
for ( let circuitStatus of circuitStatuses ) {
if ( circuitStatus . id === circuitID ) {
return circuitStatus ;
}
}
}
return null ;
} ;
// __collectIsolationData(aController)__.
Toggle all file notes
Toggle all file annotations