mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-06 22:37:14 +08:00
Log uri for guessContentTypeFromName exceptions
Summary: Add additional logging around the exception to figure out what kind of uris are causing the exception for `getContentTypeForFileName` Reviewed By: PeteTheHeat Differential Revision: D14715917 fbshipit-source-id: 46299d2ff3f1f06991d7800784a025a85815ae8c
This commit is contained in:
committed by
Facebook Github Bot
parent
15b2f994ce
commit
d9711e2693
@@ -417,7 +417,13 @@ public class CameraRollManager extends ReactContextBaseJavaModule {
|
||||
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")) {
|
||||
|
||||
Reference in New Issue
Block a user