mirror of
https://github.com/status-im/react-native-webview.git
synced 2025-02-23 17:28:37 +00:00
fix(android): add missing null check for fileTypes (#1368 by @bengy)
This commit is contained in:
parent
2639d523e9
commit
4f0f0afe70
@ -335,7 +335,11 @@ public class RNCWebViewModule extends ReactContextBaseJavaModule implements Acti
|
|||||||
// convert file extensions to mime types
|
// convert file extensions to mime types
|
||||||
if (t.matches("\\.\\w+")) {
|
if (t.matches("\\.\\w+")) {
|
||||||
String mimeType = getMimeTypeFromExtension(t.replace(".", ""));
|
String mimeType = getMimeTypeFromExtension(t.replace(".", ""));
|
||||||
mimeTypes[i] = mimeType;
|
if(mimeType != null) {
|
||||||
|
mimeTypes[i] = mimeType;
|
||||||
|
} else {
|
||||||
|
mimeTypes[i] = t;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mimeTypes[i] = t;
|
mimeTypes[i] = t;
|
||||||
}
|
}
|
||||||
@ -404,7 +408,7 @@ public class RNCWebViewModule extends ReactContextBaseJavaModule implements Acti
|
|||||||
// when our array returned from getAcceptTypes() has no values set from the webview
|
// when our array returned from getAcceptTypes() has no values set from the webview
|
||||||
// i.e. <input type="file" />, without any "accept" attr
|
// i.e. <input type="file" />, without any "accept" attr
|
||||||
// will be an array with one empty string element, afaik
|
// will be an array with one empty string element, afaik
|
||||||
return arr.length == 0 || (arr.length == 1 && arr[0].length() == 0);
|
return arr.length == 0 || (arr.length == 1 && arr[0] != null && arr[0].length() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PermissionAwareActivity getPermissionAwareActivity() {
|
private PermissionAwareActivity getPermissionAwareActivity() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user