@@ -1546,25 +1546,27 @@ function Cluster() {
15461546 recoveryListing . append ( '<li role="separator" class="divider"></li>' ) ;
15471547
15481548 // Suggest successor
1549- instance . children . forEach ( function ( replica ) {
1550- if ( ! replica . LogBinEnabled ) {
1551- return
1552- }
1553- if ( replica . SQLDelay > 0 ) {
1554- return
1555- }
1556- if ( ! replica . LogReplicationUpdatesEnabled ) {
1557- return
1558- }
1559- if ( replica . lastCheckInvalidProblem ( ) ) {
1560- return
1561- }
1562- if ( replica . notRecentlyCheckedProblem ( ) ) {
1563- return
1564- }
1565- recoveryListing . append (
1566- '<li><a href="#" data-btn="recover-suggested-successor" data-command="recover-suggested-successor" data-successor-host="' + replica . Key . Hostname + '" data-successor-port="' + replica . Key . Port + '">Recover, try to promote <code>' + replica . title + '</code></a></li>' ) ;
1567- } ) ;
1549+ if ( instance . children ) {
1550+ instance . children . forEach ( function ( replica ) {
1551+ if ( ! replica . LogBinEnabled ) {
1552+ return
1553+ }
1554+ if ( replica . SQLDelay > 0 ) {
1555+ return
1556+ }
1557+ if ( ! replica . LogReplicationUpdatesEnabled ) {
1558+ return
1559+ }
1560+ if ( replica . lastCheckInvalidProblem ( ) ) {
1561+ return
1562+ }
1563+ if ( replica . notRecentlyCheckedProblem ( ) ) {
1564+ return
1565+ }
1566+ recoveryListing . append (
1567+ '<li><a href="#" data-btn="recover-suggested-successor" data-command="recover-suggested-successor" data-successor-host="' + replica . Key . Hostname + '" data-successor-port="' + replica . Key . Port + '">Recover, try to promote <code>' + replica . title + '</code></a></li>' ) ;
1568+ } ) ;
1569+ }
15681570 }
15691571 if ( ! instance . isMaster ) {
15701572 recoveryListing . append ( '<li><a href="#" data-btn="auto" data-command="recover-auto">Auto (implies running external hooks/processes)</a></li>' ) ;
@@ -1633,7 +1635,6 @@ function Cluster() {
16331635 }
16341636 }
16351637
1636-
16371638 function indicateClusterPoolInstances ( clusterPoolInstances ) {
16381639 var instancesMap = _instancesMap ;
16391640 for ( var pool in clusterPoolInstances . Details ) {
@@ -1676,7 +1677,7 @@ function Cluster() {
16761677 instances . forEach ( function ( instance ) {
16771678 if ( instance . isMaster ) {
16781679 getData ( "/api/recently-active-instance-recovery/" + instance . Key . Hostname + "/" + instance . Key . Port , function ( recoveries ) {
1679- if ( ! recoveries ) {
1680+ if ( ! recoveries || ! recoveries . length ) {
16801681 return
16811682 }
16821683 // Result is an array: either empty (no active recovery) or with multiple entries
@@ -1767,7 +1768,7 @@ function Cluster() {
17671768 } ) ;
17681769 } ) ;
17691770 getData ( "/api/recently-active-cluster-recovery/" + currentClusterName ( ) , function ( recoveries ) {
1770- if ( ! recoveries ) {
1771+ if ( ! recoveries || ! recoveries . length ) {
17711772 return
17721773 }
17731774 // Result is an array: either empty (no active recovery) or with multiple entries
0 commit comments