-
Notifications
You must be signed in to change notification settings - Fork 16
Check for null before stringifying objects #50
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
Comments
I don't see this as a problem. In fact, in a way it is an advantage. It allows you to just use the |
It's not |
Okay. Are you proposing converting |
Yessir Edit: value = this.props.dataItemManipulator(field.name, value);
if (value === null) {
value = '';
}
if (typeof value === 'object' || typeof value === 'array') {
value = JSON.stringify(value);
} Source. Might even be worth throwing in a safety catch for |
That makes sense, assuming you can not think of any scenerios in which we would want to differentiate between |
You could either check for |
I like the latter suggestion. 👍
|
Somewhat related to #30, as
null
is an object in JavaScript it gets caught by the object if-statement and then gets stringified which converts it to a string.I think it would be best to check for
null
, and return a string before rendering the cell. Thoughts?The text was updated successfully, but these errors were encountered: