check for no employee

This commit is contained in:
Alexander Wong 2018-02-07 16:06:45 -07:00
parent 7d284010fb
commit 8dede994b4
No known key found for this signature in database
GPG Key ID: EBFE6371FA6A79DC

View File

@ -31,7 +31,7 @@ class UpdatePriceForm extends Component {
// Get referenced price // Get referenced price
const priceUUID = this.props.match.params.priceUUID; const priceUUID = this.props.match.params.priceUUID;
const price = const price =
(employee.prices || []).filter( ((employee || {}).prices || []).filter(
price => price.uuid === priceUUID && !price.deleted price => price.uuid === priceUUID && !price.deleted
)[0] || null; )[0] || null;
this.props.dispatch(setFormPriceAmount((price || {}).amount || "")); this.props.dispatch(setFormPriceAmount((price || {}).amount || ""));