Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

TypeError: Cannot read property 'toString' of nullΒ #118

Open
@fcobia

Description

@fcobia

When I have a field that is either "number" or "string" and I use just the plain decorator "@Attribute()" I get the error "TypeError: Cannot read property 'toString' of null" if the value is null. Evidently there needs to be a check for null somewhere before calling "toString."

It would be nice if it would not throw exceptions for null values.

I have had to work around this by doing the following:

	@attribute(
		{
			type: 'Custom',
			marshall: (value) => {
				
				return value ? {N: value.toString()} : null;
			},
			unmarshall: (attributeValue) => Number(attributeValue.N),
		})

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions