From 86b5b0a85d73d01b63c544dfbd37fc279185ba49 Mon Sep 17 00:00:00 2001 From: J David Smith Date: Thu, 12 Sep 2024 14:30:06 -0400 Subject: [PATCH] do not attempt to render a probability chart when no proc attempts occurred (#7022) this fixes a crash from attempting lookup in an empty array Co-authored-by: emallson --- src/CHANGELOG.tsx | 1 + src/parser/shared/modules/helpers/Probability.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/CHANGELOG.tsx b/src/CHANGELOG.tsx index acccb511bd2..878ef2df5dd 100644 --- a/src/CHANGELOG.tsx +++ b/src/CHANGELOG.tsx @@ -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), diff --git a/src/parser/shared/modules/helpers/Probability.tsx b/src/parser/shared/modules/helpers/Probability.tsx index 65e5d7aadbb..4f082d2018c 100644 --- a/src/parser/shared/modules/helpers/Probability.tsx +++ b/src/parser/shared/modules/helpers/Probability.tsx @@ -185,6 +185,9 @@ export function plotOneVariableBinomChart( title: 'Likelihood', }, ) { + if (procAttempts < 1) { + return null; + } const { procProbabilities, rangeMin, rangeMax } = setMinMaxProbabilities( actualProcs, procAttempts,