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

Error when passing nothing #44

Closed
vjpr opened this issue Nov 1, 2017 · 1 comment
Closed

Error when passing nothing #44

vjpr opened this issue Nov 1, 2017 · 1 comment

Comments

@vjpr
Copy link

vjpr commented Nov 1, 2017

Should probably check that data is defined...

console.log(prettyjson.render())
  for (var names = originalGetOPNs(object),
                   ^
TypeError: Cannot convert undefined or null to object
    at getOwnPropertyNames (<anonymous>)
    at Function.getOwnPropertyNames (/Users/Vaughan/dev-vjpr/packages/jetbrains-project/node_modules/.registry.npmjs.org/private/0.1.8/node_modules/private/private.js:72:20)
    at Object.exports.getMaxIndexLength (/Users/Vaughan/dev-vjpr/packages/jetbrains-project/node_modules/.registry.npmjs.org/prettyjson/1.2.1/node_modules/prettyjson/lib/utils.js:16:10)
    at renderToArray (/Users/Vaughan/dev-vjpr/packages/jetbrains-project/node_modules/.registry.npmjs.org/prettyjson/1.2.1/node_modules/prettyjson/lib/prettyjson.js:141:52)
    at Object.render (/Users/Vaughan/dev-vjpr/packages/jetbrains-project/node_modules/.registry.npmjs.org/prettyjson/1.2.1/node_modules/prettyjson/lib/prettyjson.js:210:10)
slavaGanzin added a commit to slavaGanzin/prettyjson that referenced this issue Oct 11, 2019
@egasimus
Copy link

This bit me. @slavaGanzin can you send a PR? @rafeca can you merge his fix?

@rafeca rafeca closed this as completed in 25a00a1 Jan 10, 2022
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

2 participants