MrWolfZ/ngrx-forms

Error thrown when setting a date field to null

aiscrim opened this issue · 1 comments

Describe the bug
If a form contains a date field that was initialized with a date, and the user then clears that field, it is set to null. This makes the reducer throw an error at this line.

The error is:
ERROR TypeError: Cannot convert undefined or null to object
at Function.keys ()

To Reproduce
Steps to reproduce the behavior:

  1. Create form state with a date value
  2. Clear the date input
  3. See error in the console

Library version:
6.3.6

If you have a Date object you might want to learn more about Value Conversion to let ngrx-forms handle it internally as a string, potentially avoiding your error.

Back to your specific issue, would be interesting to know how you handle the date (what HTML form element is displaying it) and how you clear the field (what value you see and how).