Fix crash when single-selecting large media.

pull/9/head
Greyson Parrelli 5 years ago
parent 93c1277fd0
commit 148cfd1b53

@ -129,11 +129,13 @@ class MediaSendViewModel extends ViewModel {
if (filteredMedia.isEmpty()) { if (filteredMedia.isEmpty()) {
error.setValue(Error.ITEM_TOO_LARGE); error.setValue(Error.ITEM_TOO_LARGE);
bucketId.setValue(Media.ALL_MEDIA_BUCKET_ID);
} else {
bucketId.setValue(filteredMedia.get(0).getBucketId().or(Media.ALL_MEDIA_BUCKET_ID));
} }
countButtonVisibility = CountButtonState.Visibility.FORCED_OFF; countButtonVisibility = CountButtonState.Visibility.FORCED_OFF;
bucketId.setValue(filteredMedia.get(0).getBucketId().or(Media.ALL_MEDIA_BUCKET_ID));
selectedMedia.setValue(filteredMedia); selectedMedia.setValue(filteredMedia);
countButtonState.setValue(new CountButtonState(filteredMedia.size(), countButtonVisibility)); countButtonState.setValue(new CountButtonState(filteredMedia.size(), countButtonVisibility));
}); });

Loading…
Cancel
Save