Bug 1464849: Avoid to render the graph in case of animation was removed. r=gl

MozReview-Commit-ID: HREpfImDKum

--HG--
extra : rebase_source : 1b9e0ee2b81fd291bc9d7bbb248ccbfa61b114e2
This commit is contained in:
Daisuke Akatsuka 2018-05-29 18:12:38 +09:00
Родитель 1b8f9ac1a6
Коммит b8501fd3a3
1 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -184,17 +184,15 @@ class SummaryGraphPath extends Component {
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