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 {
142
142
return ;
143
143
}
144
144
145
+ const { assets } = response ;
146
+
145
147
// TODO: support sending multiple files; see library's docs for how to
146
148
// let `assets` have more than one item in `response`.
147
- const firstAsset = response . assets && response . assets [ 0 ] ;
149
+ const firstAsset = assets && assets [ 0 ] ;
148
150
149
151
if ( ! firstAsset ) {
150
152
// TODO: See if we these unexpected situations actually happen. …Ah,
151
153
// yep, reportedly (and we've seen in Sentry):
152
154
// https://github.com/react-native-image-picker/react-native-image-picker/issues/1945
153
155
showErrorAlert ( _ ( 'Error' ) , _ ( 'Failed to attach your file.' ) ) ;
154
156
logging . error ( 'Image picker response gave falsy `assets` or falsy `assets[0]`' , {
155
- '!assets' : ! response . assets ,
157
+ '!assets' : ! assets ,
156
158
} ) ;
157
159
return ;
158
160
}
You can’t perform that action at this time.
0 commit comments