File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
package/expo-package/src/optionalDependencies Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ export const takePhoto = ImagePicker
4848 } ) ;
4949 const canceled = imagePickerSuccessResult . canceled ;
5050 const assets = imagePickerSuccessResult . assets ;
51- // since we only support single photo upload for now we will only be focusing on 0'th element.
52- const photo = assets && assets [ 0 ] ;
53- if ( canceled ) {
51+ if ( canceled || ! assets . length ) {
5452 return { cancelled : true } ;
5553 }
54+ // since we only support single photo upload for now we will only be focusing on 0'th element.
55+ const photo = assets [ 0 ] ;
5656 if ( photo . mimeType . includes ( 'video' ) ) {
5757 const clearFilter = new RegExp ( '[.:]' , 'g' ) ;
5858 const date = new Date ( ) . toISOString ( ) . replace ( clearFilter , '_' ) ;
You can’t perform that action at this time.
0 commit comments