Closed ahoym closed 6 years ago
Currently applications consuming redesert and using the get*ErrorsById selector will break if the entity that get*ErrorsById is trying to access doesn't exist. This is because it is trying to access a property of undefined or null.
redesert
get*ErrorsById
undefined
null
Like in https://github.com/ahoym/redesert/pull/21, we should add an existence check to: https://github.com/ahoym/redesert/blob/1768160009ea6ea6a109c91ebf9cbcd507dcf59c/src/selector-factories/base-selectors.ts#L46
Using get*ErrorsById if the entity doesn't exist should return undefined or null depending on the user's designated default
entity
Resolved by: https://github.com/ahoym/redesert/pull/27, should be in v0.6.3
Is this a feature request or a bug report?
What is the current behavior?
Currently applications consuming
redesert
and using theget*ErrorsById
selector will break if the entity thatget*ErrorsById
is trying to access doesn't exist. This is because it is trying to access a property ofundefined
ornull
.Like in https://github.com/ahoym/redesert/pull/21, we should add an existence check to: https://github.com/ahoym/redesert/blob/1768160009ea6ea6a109c91ebf9cbcd507dcf59c/src/selector-factories/base-selectors.ts#L46
What is the expected behavior?
Using
get*ErrorsById
if theentity
doesn't exist should returnundefined
ornull
depending on the user's designated default