Skip to content

Commit 39c6472

Browse files
authored
Merge pull request #32 from john-paradym/fix-stopHandlerAnimation-crashes
Handle null animation or controller in _stopHandlerAnimation function
2 parents 9411ebf + da2744c commit 39c6472

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/another_xlider.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,13 +1716,13 @@ class FlutterSliderState extends State<FlutterSlider> with TickerProviderStateMi
17161716

17171717
void _stopHandlerAnimation({Animation? animation, AnimationController? controller}) {
17181718
if (widget.handlerAnimation.reverseCurve != null) {
1719-
if (animation!.isCompleted) {
1720-
controller!.reverse();
1719+
if (animation?.isCompleted ?? false) {
1720+
controller?.reverse();
17211721
} else {
1722-
controller!.reset();
1722+
controller?.reset();
17231723
}
17241724
} else {
1725-
controller!.reset();
1725+
controller?.reset();
17261726
}
17271727
}
17281728

0 commit comments

Comments
 (0)