Skip to content
Snippets Groups Projects
Commit 0de68ed0 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Use `String(value)` instead of `value.toString()` as it supports nulls

parent 5fa2c4fb
No related branches found
No related tags found
No related merge requests found
......@@ -85,5 +85,5 @@ export function getFieldValues(field: ?Field): FieldValues {
export function getHumanReadableValue(value: Value, fieldValues?: FieldValues = []) {
const fieldValue = _.findWhere(fieldValues, { [0]: value });
return fieldValue && fieldValue.length === 2 ? fieldValue[1] : value.toString();
return fieldValue && fieldValue.length === 2 ? fieldValue[1] : String(value);
}
......@@ -97,7 +97,7 @@ export default class CategoryWidget extends Component {
})}
onClick={() => { setValue(rawValue); onClose(); }}
>
{humanReadableValue || rawValue.toString()}
{humanReadableValue || String(rawValue)}
</li>
)}
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment