Error: 'b' is null or not an object

This error has caused me so much pain when trying to use SharePoint’s JavaScript client-side object model (CSOM), so, in case I have it again:

  1. Check that the function exists.
  2. Check that the function is named correctly.
  3. Make sure that you’re not using “this” in the call to createDelegate, as detailed here.
    • Right: Function.createDelegate(this, onSuccessMethod)
    • Wrong: Function.createDelegate(this, this.onSuccessMethod)

    I don’t know why this difference should cause this error, but I’ve proved it true.

If you know of other causes of this error, let me know, I’ll add it to the list. I love the experience of debugging JavaScript…

Error: 'b' is null or not an object

4 thoughts on “Error: 'b' is null or not an object

  1. I have also had the error message “Unable to get value of the property ‘apply’: object is null or undefined” which had the same cause.

  2. Anusha says:

    Thank you so much 🙂 ur post was just the thing i was looking for.. spent two days on this issue..

  3. Manesh says:

    Thanks a lot . I was facing same issue .
    One more thing ,though it has given this error , item was created successfully.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.