mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-20 07:52:53 +08:00
CB-919: Camera Plugin returned with empty error message
Guarding against null cursor.
This commit is contained in:
parent
a691e9f744
commit
c1c9075962
@ -524,6 +524,7 @@ public class CameraLauncher extends Plugin {
|
|||||||
private void checkForDuplicateImage(int type) {
|
private void checkForDuplicateImage(int type) {
|
||||||
int diff = 1;
|
int diff = 1;
|
||||||
Cursor cursor = queryImgDB();
|
Cursor cursor = queryImgDB();
|
||||||
|
if (cursor != null) {
|
||||||
int currentNumOfImages = cursor.getCount();
|
int currentNumOfImages = cursor.getCount();
|
||||||
|
|
||||||
if (type == FILE_URI) {
|
if (type == FILE_URI) {
|
||||||
@ -538,6 +539,7 @@ public class CameraLauncher extends Plugin {
|
|||||||
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
|
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compress bitmap using jpeg, convert to Base64 encoded string, and return to JavaScript.
|
* Compress bitmap using jpeg, convert to Base64 encoded string, and return to JavaScript.
|
||||||
|
@ -424,6 +424,7 @@ public class Capture extends Plugin {
|
|||||||
*/
|
*/
|
||||||
private void checkForDuplicateImage() {
|
private void checkForDuplicateImage() {
|
||||||
Cursor cursor = queryImgDB();
|
Cursor cursor = queryImgDB();
|
||||||
|
if (cursor != null) {
|
||||||
int currentNumOfImages = cursor.getCount();
|
int currentNumOfImages = cursor.getCount();
|
||||||
|
|
||||||
// delete the duplicate file if the difference is 2
|
// delete the duplicate file if the difference is 2
|
||||||
@ -434,4 +435,5 @@ public class Capture extends Plugin {
|
|||||||
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
|
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user