From d92f155a88fd5eb90dd2bee3f2ec8915c990800a Mon Sep 17 00:00:00 2001 From: ebda3is Date: Tue, 2 Feb 2016 23:02:49 +0200 Subject: [PATCH] Fix error fix error "Uncaught TypeError: Cannot read property 'shift' of null counterup" --- jquery.counterup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery.counterup.js b/jquery.counterup.js index bc7871f..ad4b00a 100644 --- a/jquery.counterup.js +++ b/jquery.counterup.js @@ -59,6 +59,9 @@ // Updates the number until we're done var f = function() { + if(!$this.data('counterup-nums')){ + return; + } $this.text($this.data('counterup-nums').shift()); if ($this.data('counterup-nums').length) { setTimeout($this.data('counterup-func'), $settings.delay); @@ -80,4 +83,4 @@ }; -})( jQuery ); \ No newline at end of file +})( jQuery );