File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -142,17 +142,19 @@ export default function ComposeMenu(props: Props): Node {
142142 return ;
143143 }
144144
145+ const { assets } = response ;
146+
145147 // TODO: support sending multiple files; see library's docs for how to
146148 // let `assets` have more than one item in `response`.
147- const firstAsset = response . assets && response . assets [ 0 ] ;
149+ const firstAsset = assets && assets [ 0 ] ;
148150
149151 if ( ! firstAsset ) {
150152 // TODO: See if we these unexpected situations actually happen. …Ah,
151153 // yep, reportedly (and we've seen in Sentry):
152154 // https://github.com/react-native-image-picker/react-native-image-picker/issues/1945
153155 showErrorAlert ( _ ( 'Error' ) , _ ( 'Failed to attach your file.' ) ) ;
154156 logging . error ( 'Image picker response gave falsy `assets` or falsy `assets[0]`' , {
155- '!assets' : ! response . assets ,
157+ '!assets' : ! assets ,
156158 } ) ;
157159 return ;
158160 }
You can’t perform that action at this time.
0 commit comments