Error checking and deleting old profile image

This commit is contained in:
2019-12-03 23:46:04 -05:00
parent ebca5192e0
commit 79051f2243
2 changed files with 108 additions and 103 deletions

View File

@@ -168,10 +168,12 @@ export class edit extends Component {
};
handleImageChange = (event) => {
const image = event.target.files[0];
const formData = new FormData();
formData.append('image', image, image.name);
this.props.uploadImage(formData);
if (event.target.files[0]) {
const image = event.target.files[0];
const formData = new FormData();
formData.append('image', image, image.name);
this.props.uploadImage(formData);
}
}
handleEditPicture = () => {