Skip to content

fix: add an empty array fallback for fields with multiple documents type#300

Merged
birkir merged 1 commit intobirkir:masterfrom
pdrvsky:fix/multiple-documents-null
Aug 7, 2019
Merged

fix: add an empty array fallback for fields with multiple documents type#300
birkir merged 1 commit intobirkir:masterfrom
pdrvsky:fix/multiple-documents-null

Conversation

@pdrvsky
Copy link
Copy Markdown
Contributor

@pdrvsky pdrvsky commented Aug 2, 2019

By an accident I've found a bug which was causing a query to fail. When you create a field with a type of multiple documents and then publish a post without any value added it will fail on trying to access map method on null value. The fix was to simply provide an empty array fallback in PrimeFieldDocument class.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 2, 2019

Codecov Report

Merging #300 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #300   +/-   ##
=======================================
  Coverage   79.34%   79.34%           
=======================================
  Files         108      108           
  Lines        2184     2184           
  Branches      169      153   -16     
=======================================
  Hits         1733     1733           
- Misses        432      433    +1     
+ Partials       19       18    -1
Impacted Files Coverage Δ
...ges/prime-field-document/src/PrimeFieldDocument.ts 51.06% <0%> (ø) ⬆️
packages/prime-core/src/utils/connect.ts 91.66% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c7a372...331a891. Read the comment docs.

@birkir birkir merged commit 63fad25 into birkir:master Aug 7, 2019
@birkir
Copy link
Copy Markdown
Owner

birkir commented Aug 7, 2019

Thank you @pdrvsky !

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.

2 participants