Skip to content

Commit ef926fa

Browse files
authored
Merge pull request #20920 from apache/fix/custom-series-NPE
fix(custom): fix potential NPE when applying leave transition
2 parents f6ebee9 + 403db55 commit ef926fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/animation/customGraphicTransition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ export function applyLeaveTransition(
223223
// TODO Data index?
224224
const config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);
225225
config.done = () => {
226-
parent.remove(el);
226+
parent && parent.remove(el);
227227
onRemove && onRemove();
228228
};
229229
el.animateTo(leaveToProps, config);
230230
}
231231
else {
232-
parent.remove(el);
232+
parent && parent.remove(el);
233233
onRemove && onRemove();
234234
}
235235
}

0 commit comments

Comments
 (0)