You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
Trying to marshal an object that contains a null value results in a TypeError:
ipld.marshal({foo: null})
TypeError: Cannot convert undefined or null to object
at transform (/Users/yusef/Work/Code/aleph/node_modules/ipld/lib/cbor.js:24:23)
at /Users/yusef/Work/Code/aleph/node_modules/ipld/lib/cbor.js:29:20
at Array.forEach (native)
at transform (/Users/yusef/Work/Code/aleph/node_modules/ipld/lib/cbor.js:27:10)
at Object.exports.marshal (/Users/yusef/Work/Code/aleph/node_modules/ipld/lib/cbor.js:55:22)
at repl:1:-56
at ContextifyScript.Script.runInThisContext (vm.js:25:33)
at Object.exports.runInThisContext (vm.js:77:17)
at _eval (/Users/yusef/Work/Code/aleph/node_modules/babel-cli/lib/_babel-node.js:103:23)
at REPLServer.replEval (/Users/yusef/Work/Code/aleph/node_modules/babel-cli/lib/_babel-node.js:185:14)
This can be fixed by adding a null check to the transform function in cbor.js
Trying to marshal an object that contains a null value results in a
TypeError
:This can be fixed by adding a null check to the
transform
function in cbor.jsThis is apparently because javascript thinks
typeof null === 'object'
😝The text was updated successfully, but these errors were encountered: