From cb27f0f937e842c3a7c6df69d0a6cf65636c4269 Mon Sep 17 00:00:00 2001 From: errnull Date: Sun, 7 Apr 2019 17:43:21 +0800 Subject: [PATCH] fix: return when videoItem is nil in startAnimation. --- Source/SVGAPlayer.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index ac46fb5..a3c9b9a 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -54,6 +54,10 @@ - (void)willMoveToSuperview:(UIView *)newSuperview { } - (void)startAnimation { + if (self.videoItem == nil) { + NSLog(@"videoItem could not be nil!"); + return; + } [self stopAnimation:NO]; self.loopCount = 0; self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(next)];