New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: elems must be an array for can.inserted() #2298

Merged
merged 1 commit into from Mar 4, 2016

Conversation

Projects
None yet
3 participants
@lastzero
Contributor

lastzero commented Mar 1, 2016

Without this fix, canjs/util/inserted/inserted.js can fail at line 7...

if(!elems.length) {
  return;
}

...since length is undefined:

TypeError: Cannot read property 'length' of undefined

@justinbmeyer justinbmeyer added the bug label Mar 1, 2016

@justinbmeyer justinbmeyer added this to the 2.3.18 milestone Mar 1, 2016

@justinbmeyer justinbmeyer self-assigned this Mar 1, 2016

@daffl daffl modified the milestones: 2.3.19, 2.3.18 Mar 3, 2016

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Mar 4, 2016

Contributor

@lastzero how did this fail?

Contributor

justinbmeyer commented Mar 4, 2016

@lastzero how did this fail?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Mar 4, 2016

Contributor

meaning ... is there some code that you ran that caused the error?

Contributor

justinbmeyer commented Mar 4, 2016

meaning ... is there some code that you ran that caused the error?

@lastzero

This comment has been minimized.

Show comment
Hide comment
@lastzero

lastzero Mar 4, 2016

Contributor

It was caused by some jquery plugin - probably select2. We came across this while refactoring existing code...

Contributor

lastzero commented Mar 4, 2016

It was caused by some jquery plugin - probably select2. We came across this while refactoring existing code...

@lastzero

This comment has been minimized.

Show comment
Hide comment
@lastzero

lastzero Mar 4, 2016

Contributor

Not select2, but some datetime picker in conjunction with moment.js.

Contributor

lastzero commented Mar 4, 2016

Not select2, but some datetime picker in conjunction with moment.js.

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Mar 4, 2016

Contributor

That makes sense. One of those plugins probably called the method with null which seems to be valid in jQuery.

Contributor

daffl commented Mar 4, 2016

That makes sense. One of those plugins probably called the method with null which seems to be valid in jQuery.

daffl added a commit that referenced this pull request Mar 4, 2016

Merge pull request #2298 from lastzero/patch-1
Bugfix: elems must be an array for can.inserted()

@daffl daffl merged commit 0f89261 into canjs:master Mar 4, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lastzero

This comment has been minimized.

Show comment
Hide comment
@lastzero

lastzero Mar 4, 2016

Contributor

Yeah, I think arguments was [null]

Contributor

lastzero commented Mar 4, 2016

Yeah, I think arguments was [null]

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