This repository was archived by the owner on Dec 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
components/Snackbar/src/private Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -580,12 +580,18 @@ - (void)slideMessageView:(MDCSnackbarMessageView *)snackbarView
580580 duration: duration
581581 timingFunction: timingFunction];
582582 } else {
583- NSMutableArray *animations =
584- [NSMutableArray arrayWithObject: [snackbarView animateSnackbarOpacityFrom: fromContentOpacity
585- to: toContentOpacity]];
583+ NSMutableArray *animations = [[NSMutableArray alloc ] init ];
584+ CABasicAnimation *opacityAnimation = [snackbarView animateSnackbarOpacityFrom: fromContentOpacity
585+ to: toContentOpacity];
586+ if (opacityAnimation) {
587+ [animations addObject: opacityAnimation];
588+ }
586589 if (onscreen) {
587- [animations addObject: [snackbarView animateSnackbarScaleFrom: MDCSnackbarEnterStartingScale
588- toScale: 1 ]];
590+ CABasicAnimation *scaleAnimation =
591+ [snackbarView animateSnackbarScaleFrom: MDCSnackbarEnterStartingScale toScale: 1 ];
592+ if (scaleAnimation) {
593+ [animations addObject: scaleAnimation];
594+ }
589595 }
590596 animationsGroup.animations = animations;
591597 [snackbarView.layer addAnimation: animationsGroup forKey: @" snackbarAnimation" ];
You can’t perform that action at this time.
0 commit comments