Skip to content

Commit

Permalink
safely access policy id
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Dec 26, 2023
1 parent 8c845fb commit d0e8f34
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useMemo} from 'react';
import {View} from 'react-native';
Expand Down Expand Up @@ -336,7 +337,7 @@ export default compose(
withNavigationFocus,
withOnyx({
policy: {
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`,
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${lodashGet(report, 'policyID')}`,
},
}),
)(AttachmentPickerWithMenuItems);

0 comments on commit d0e8f34

Please sign in to comment.