Skip to content

Commit

Permalink
Merge pull request #20 from Qeepsake/fixed_error_with_file_stream
Browse files Browse the repository at this point in the history
fix(java): fixed issue with java not checking for null and assuming boolean
  • Loading branch information
Luke Brandon Farrell authored Dec 30, 2021
2 parents 0503219 + 64d0e8d commit fac78fb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ public void getTimestamp(String uri, String mediaType, Promise promise) {

// Handle getting mime type for images
if (mediaType.equalsIgnoreCase("image")) {
InputStream inputStream;
InputStream inputStream = null;

if(URLUtil.isContentUrl(uri)) {
inputStream = mContext.getContentResolver().openInputStream(fileUri);
} else if(URLUtil.isFileUrl(uri)) {
inputStream = new FileInputStream(uri);
}

if(inputStream) {
if(inputStream != null) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
ExifInterface exif = new ExifInterface(inputStream);
String timestamp = exif.getAttribute(ExifInterface.TAG_DATETIME);
Expand Down

0 comments on commit fac78fb

Please sign in to comment.