Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/components/shared/thread/ActivityGraphFills.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ export class ActivityFillGraphQuerier {
): HoveredPixelState | null {
const {
rangeFilteredThread: { samples, stackTable },
greyCategoryIndex,
} = this.renderedComponentSettings;
const { devicePixelRatio } = window;
const deviceX = Math.round(cssX * devicePixelRatio);
Expand Down Expand Up @@ -437,10 +436,13 @@ export class ActivityFillGraphQuerier {
// iteration - in the first iteration, yPercentage can be == categoryLowerEdge.)
for (const { sample, contribution } of candidateSamples) {
const stackIndex = samples.stack[sample];
const sampleCategory =
stackIndex !== null
? stackTable.category[stackIndex]
: greyCategoryIndex;
if (stackIndex === null) {
console.error(
`Stack index was null for sample index ${sample}, this shouldn't happen normally, please fix your source of data.`
);
continue;
}
const sampleCategory = stackTable.category[stackIndex];
const upperEdgeOfThisSample = upperEdgeOfPreviousSample + contribution;
// Checking the sample category here because there are samples with different
// categories that has y percentage is lower than the upperEdgeOfThisSample.
Expand Down