diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/camera/CameraRollManager.java b/ReactAndroid/src/main/java/com/facebook/react/modules/camera/CameraRollManager.java index ceb838df72b430..73a7f4ae88f6f1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/camera/CameraRollManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/camera/CameraRollManager.java @@ -417,7 +417,13 @@ private static boolean putImageInfo( float width = media.getInt(widthIndex); float height = media.getInt(heightIndex); - String mimeType = URLConnection.guessContentTypeFromName(photoUri.toString()); + String mimeType; + try { + mimeType = URLConnection.guessContentTypeFromName(photoUri.toString()); + } catch (StringIndexOutOfBoundsException e) { + FLog.e(ReactConstants.TAG, "Unable to guess content type from " + photoUri.toString(), e); + throw e; + } if (mimeType != null && mimeType.startsWith("video")) {