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

fix: fixing cannot read property 'type' of null #682

Closed
wants to merge 3 commits into from

Conversation

quan-qodespace
Copy link

Fixes a bug where a nested object property is null, this would cause this line to error because typeof null returns 'object' but obj.type would cause an exception.

Summary:

Cannot read property 'type' of null error when working with saveUnknown is true and contains nested array of objects and when there's a null property.

Is this ready to be merged into Dynamoose? (select 1):

  • Yes
  • No

Other:

  • I have searched through the GitHub pull requests to ensure this PR has not already been submitted
  • I have updated the Dynamoose documentation (if required) given the changes I made
  • I have added/updated the Dynamoose test cases (if required) given the changes I made
  • I agree that all changes made in this pull request may be distributed and are made available in accordance with the Dynamoose license
  • All of my commits and commit messages are detailed, explain what changes were made, and are easy to follow and understand
  • I have filled out all fields above

Fixes a bug where a nested object property is null, this would cause this line to error because typeof null returns 'object' but obj.type would cause an exception.
@coveralls
Copy link

coveralls commented Sep 28, 2019

Pull Request Test Coverage Report for Build 1121

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 85.324%

Totals Coverage Status
Change from base Build 1118: -0.2%
Covered Lines: 6308
Relevant Lines: 7218

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1120

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 85.403%

Totals Coverage Status
Change from base Build 1118: -0.08%
Covered Lines: 6313
Relevant Lines: 7218

💛 - Coveralls

@teamclicker
Copy link

Am seeing this also. Any workaround until this gets merged?

@Gabiras12
Copy link

@fishcharlie can we merge this?

  • try to save a unknown Attribute
  • unknown attribute is an object with a property with value null
  • Cannot read property 'type' of null

@fishcharlie
Copy link
Member

@Gabiras12 Nope. This PR was submitted against v1. v1 is no longer maintained. Please upgrade to v2.

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

Successfully merging this pull request may close these issues.

None yet

6 participants