Bug 1464849: Avoid to render the graph in case of animation was removed. r?gl
MozReview-Commit-ID: HREpfImDKum
--- a/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js
+++ b/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js
@@ -179,27 +179,25 @@ class SummaryGraphPath extends Component
}
);
emitEventForTest("animation-summary-graph-rendered");
}
render() {
const { durationPerPixel, keyframesList } = this.state;
+ const { animation, simulateAnimation, timeScale } = this.props;
- if (!durationPerPixel) {
+ if (!durationPerPixel || !animation.state.type) {
+ // Undefined animation.state.type means that the animation had been removed already.
+ // Even if the animation was removed, we still need the empty svg since the
+ // component might be re-used.
return dom.svg();
}
- const {
- animation,
- simulateAnimation,
- timeScale,
- } = this.props;
-
const { createdTime, playbackRate } = animation.state;
// If createdTime is not defined (which happens when connected to server older
// than FF62), use previousStartTime instead. See bug 1454392
const baseTime = typeof createdTime === "undefined"
? (animation.state.previousStartTime || 0)
: createdTime;
// Absorb the playbackRate in viewBox of SVG and offset of child path elements