Skip to content
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

Cannot convert undefined or null to object #2

Closed
eamodio opened this issue Oct 24, 2016 · 0 comments
Closed

Cannot convert undefined or null to object #2

eamodio opened this issue Oct 24, 2016 · 0 comments

Comments

@eamodio
Copy link

eamodio commented Oct 24, 2016

Since the update to Quill 1.1.2 (and specifically this commit)

I'm getting the following error:

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Delta.insert (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:2243:54)
    at eval (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:3612:26)
    at Array.reduce (native)
    at Delta.reduce (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:2317:25)
    at normalizeDelta (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:3595:22)
    at Editor.applyDelta (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:3345:21)
    at eval (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:1959:44)
    at Quill.modify (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:2089:22)
    at Quill.setContents (https://au.fdy.io:5100/jspm_packages/npm/quill@1.1.2/dist/quill.js:1955:27)
    at RichEditable.setValue (https://au.fdy.io:5100/dist/components/editable/rich-editable.js:34:33)
    at RichEditable.attached (https://au.fdy.io:5100/dist/components/editable/editable-base.js:47:26)
    at Controller.attached (https://au.fdy.io:5100/jspm_packages/npm/aurelia-templating@1.1.2/aurelia-templating.js:3472:24)
    at View.attached (https://au.fdy.io:5100/jspm_packages/npm/aurelia-templating@1.1.2/aurelia-templating.js:1563:24)
    at ViewSlot.add (https://au.fdy.io:5100/jspm_packages/npm/aurelia-templating@1.1.2/aurelia-templating.js:1726:14)
    at eval (https://au.fdy.io:5100/jspm_packages/npm/aurelia-templating@1.1.2/aurelia-templating.js:4417:28)

It is because sometimes from our server the attributes on an insert object exists but is null or undefined.

It looks like a null/undefined check needs to be added here:
https://github.com/quilljs/delta/blob/master/lib/delta.js#L26
and here:
https://github.com/quilljs/delta/blob/master/lib/delta.js#L38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant