mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Merge pull request #1201 from nextcloud/autoUploadCrashIfFilepathIsNull
Auto upload crash if filepath is null
This commit is contained in:
commit
13b841b67f
2 changed files with 10 additions and 4 deletions
|
@ -119,11 +119,17 @@ public class MediaProvider {
|
|||
|
||||
if (cursorImages != null) {
|
||||
String filePath;
|
||||
int failedImages = 0;
|
||||
while (cursorImages.moveToNext()) {
|
||||
filePath = cursorImages.getString(cursorImages.getColumnIndexOrThrow(
|
||||
MediaStore.MediaColumns.DATA));
|
||||
|
||||
if (filePath != null) {
|
||||
mediaFolder.filePaths.add(filePath);
|
||||
mediaFolder.absolutePath = filePath.substring(0, filePath.lastIndexOf("/"));
|
||||
} else {
|
||||
failedImages++;
|
||||
}
|
||||
}
|
||||
cursorImages.close();
|
||||
|
||||
|
@ -139,7 +145,7 @@ public class MediaProvider {
|
|||
null);
|
||||
|
||||
if (count != null) {
|
||||
mediaFolder.numberOfFiles = count.getCount();
|
||||
mediaFolder.numberOfFiles = count.getCount() - failedImages;
|
||||
count.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:textColor="#bcbcbc"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue