mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42: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) {
|
||||
int diff = 1;
|
||||
Cursor cursor = queryImgDB();
|
||||
if (cursor != null) {
|
||||
int currentNumOfImages = cursor.getCount();
|
||||
|
||||
if (type == FILE_URI) {
|
||||
@ -538,6 +539,7 @@ public class CameraLauncher extends Plugin {
|
||||
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
Cursor cursor = queryImgDB();
|
||||
if (cursor != null) {
|
||||
int currentNumOfImages = cursor.getCount();
|
||||
|
||||
// delete the duplicate file if the difference is 2
|
||||
@ -435,3 +436,4 @@ public class Capture extends Plugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user