Skip to content

Commit

Permalink
do not attempt to render a probability chart when no proc attempts oc…
Browse files Browse the repository at this point in the history
…curred (WoWAnalyzer#7022)

this fixes a crash from attempting lookup in an empty array

Co-authored-by: emallson <emallson@aeaea>
  • Loading branch information
emallson and emallson authored Sep 12, 2024
1 parent 6e29705 commit 86b5b0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 9, 12), 'Fixed crash when analyzing reports where 0 procs of certain effects ocurred.', emallson),
change(date(2024, 9, 12), 'Add support for Earthen characters.', ToppleTheNun),
change(date(2024, 9, 10), 'Change behavior of getLowestPerf when no perfs are provided', Trevor),
change(date(2024, 9, 9), 'Fix character search showing UNKNOWN instead of THE WAR WITHIN.', ToppleTheNun),
Expand Down
3 changes: 3 additions & 0 deletions src/parser/shared/modules/helpers/Probability.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ export function plotOneVariableBinomChart(
title: 'Likelihood',
},
) {
if (procAttempts < 1) {
return null;
}
const { procProbabilities, rangeMin, rangeMax } = setMinMaxProbabilities(
actualProcs,
procAttempts,
Expand Down

0 comments on commit 86b5b0a

Please sign in to comment.