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 read property 'length' of null #21

Closed
naman7kr opened this issue Dec 2, 2020 · 4 comments
Closed

Cannot read property 'length' of null #21

naman7kr opened this issue Dec 2, 2020 · 4 comments
Labels
type/bug Unexpected behavior or a feature is broken

Comments

@naman7kr
Copy link

naman7kr commented Dec 2, 2020

I am getting this error when I tried to access "createdBy" ($.[*].createdBy) from the jsonFile (https://github.com/marcusolsson/grafana-json-datasource/files/5626718/error_json.txt). When I changed the value of first "createdBy" to string and second "createdBy" to null, then the error vanishes and I get the required table. So if any value in the first row of the table is null, then the table crashes and I get this error.

error_json.txt

@jinxiao
Copy link

jinxiao commented Dec 2, 2020

I think I have the same problem.
I change a value field to null , then it turned to error.
For this scenario, we changed null to "null", ie, make it a string , then it works.

@marcusolsson
Copy link
Contributor

Thanks for reporting this! 🙏 I can confirm that I'm able to reproduce this. Will debug and get back to you!

@marcusolsson marcusolsson added the type/bug Unexpected behavior or a feature is broken label Dec 2, 2020
@marcusolsson
Copy link
Contributor

The schema detection fails because the null values. I've submitted a fix for this in 4f8cd79.

I'd like to add a few more fixes because I create a new release. Hope that's ok with you! 🙏

@naman7kr
Copy link
Author

naman7kr commented Dec 4, 2020

Version 0.7.0 Works like a charm. Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Unexpected behavior or a feature is broken
Projects
None yet
Development

No branches or pull requests

3 participants