react-native-fileupload icon indicating copy to clipboard operation
react-native-fileupload copied to clipboard

Error: upload without files will crash

Open yeatsYz opened this issue 7 years ago • 0 comments

var obj = { uploadUrl: options.uploadUrl, method: 'POST', headers: {}, fields: {}, files: [] }; NativeModules.FileUpload.upload(obj, function(err, result) { if (result && result.data === 'ok') { handleRight() } else { handleError(); } });

in FileUploadModule.java/upload fileInputStream.close(); this line will crash as i pass an empty files array, I think maybe here should have a judge if files array is empty

yeatsYz avatar Sep 28 '17 08:09 yeatsYz