Fixed #4232 App crashes on trying to upload a media from gallery. (#4235)

* ExifFixed

* requested changes

* requested changes

* indentation
This commit is contained in:
Aditya-Srivastav 2021-02-17 15:08:11 +05:30 committed by GitHub
parent 6293f90950
commit 7cb5ff9167
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,8 +124,8 @@ public class UploadableFile implements Parcelable {
private DateTimeWithSource getDateTimeFromExif() {
try {
ExifInterface exif = new ExifInterface(file.getAbsolutePath());
@SuppressLint("RestrictedApi") long dateTime = exif.getDateTime();
if (dateTime != -1) {
@SuppressLint("RestrictedApi") Long dateTime = exif.getDateTime();
if(dateTime != null){
Date date = new Date(dateTime);
return new DateTimeWithSource(date, DateTimeWithSource.EXIF_SOURCE);
}