Skip to content

Commit 08e274a

Browse files
aherlihydurran
authored andcommitted
COMPASS-385 - Check data exists before modifying overlays for RTSS tables (#700)
1 parent 138512f commit 08e274a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/internal-packages/server-stats/lib/store/current-op-store.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ const CurrentOpStore = Reflux.createStore({
5050
}
5151
this.overlayIndex = index;
5252
this.inOverlay = true;
53-
this.trigger(visErrors[this.overlayIndex], visOps[this.overlayIndex]);
53+
const data = visOps.length === 0 ? [] : visOps[this.overlayIndex];
54+
this.trigger(visErrors[this.overlayIndex], data);
5455
},
5556

5657
mouseOut: function() {
5758
this.inOverlay = false;
5859
const startPause = Math.max(this.endPause - this.xLength, 0);
5960
const visOps = this.allOps.slice(startPause, this.endPause);
6061
const visErrors = this.errored.slice(startPause, this.endPause);
61-
this.trigger(visErrors[this.overlayIndex], visOps[visOps.length - 1]);
62+
const data = visOps.length === 0 ? [] : visOps[visOps.length - 1];
63+
this.trigger(visErrors[this.overlayIndex], data);
6264
},
6365

6466
currentOp: function() {

src/internal-packages/server-stats/lib/store/top-store.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ const TopStore = Reflux.createStore({
5151
}
5252
this.overlayIndex = index;
5353
this.inOverlay = true;
54-
this.trigger(visErrors[this.overlayIndex], visOps[this.overlayIndex]);
54+
const data = visOps.length === 0 ? [] : visOps[this.overlayIndex];
55+
this.trigger(visErrors[this.overlayIndex], data);
5556
},
5657

5758
mouseOut: function() {
5859
this.inOverlay = false;
5960
const startPause = Math.max(this.endPause - this.xLength, 0);
6061
const visOps = this.allOps.slice(startPause, this.endPause);
6162
const visErrors = this.errored.slice(startPause, this.endPause);
62-
this.trigger(visErrors[this.overlayIndex], visOps[visOps.length - 1]);
63+
const data = visOps.length === 0 ? [] : visOps[visOps.length - 1];
64+
this.trigger(visErrors[this.overlayIndex], data);
6365
},
6466

6567
// Calculate list as current hottest collection (like Cloud and system top)

0 commit comments

Comments
 (0)