Skip to content

Commit 64d0e8d

Browse files
author
Luke Farrell
committed
fix(java): fixed issue with java not checking for null and assuming boolean
1 parent 0503219 commit 64d0e8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/src/main/java/com/reactnativefileutils/FileUtilsModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ public void getTimestamp(String uri, String mediaType, Promise promise) {
143143

144144
// Handle getting mime type for images
145145
if (mediaType.equalsIgnoreCase("image")) {
146-
InputStream inputStream;
146+
InputStream inputStream = null;
147147

148148
if(URLUtil.isContentUrl(uri)) {
149149
inputStream = mContext.getContentResolver().openInputStream(fileUri);
150150
} else if(URLUtil.isFileUrl(uri)) {
151151
inputStream = new FileInputStream(uri);
152152
}
153153

154-
if(inputStream) {
154+
if(inputStream != null) {
155155
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
156156
ExifInterface exif = new ExifInterface(inputStream);
157157
String timestamp = exif.getAttribute(ExifInterface.TAG_DATETIME);

0 commit comments

Comments
 (0)