Uncaught TypeError: Cannot read property 'slice' of undefined #121

Closed
pestka opened this Issue Sep 24, 2015 · 4 comments

Projects

None yet

2 participants

@pestka
pestka commented Sep 24, 2015

Script gives this error if target does not exist.

@flesler
Owner
flesler commented Sep 24, 2015

You mean if target is null? That's not a valid value to be passed to the plugin.
It does support an empty jQuery object so it doesn't break when used on several pages, but passing null or undefined makes no sense.

Could you describe the situation? thanks

@pestka
pestka commented Sep 24, 2015

Thanks for quick response.
Just pass a jquery object with selector that gives empty jquery set, ex:

$.scrollTo($("doesnotexist"));
@flesler flesler added a commit that closed this issue Sep 24, 2015
@flesler Fixed #121 d33ae45
@flesler flesler closed this in d33ae45 Sep 24, 2015
@flesler
Owner
flesler commented Sep 24, 2015

You were right, it was handled when passing a selector but not a jQuery object, it now is. Can you download 2.1.2 and confirm it's fixed?
Thanks

@pestka
pestka commented Sep 24, 2015

Yep, it's fixed in 2.1.2.
Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment