Native rewrite #878

Merged
akinwale merged 65 commits from native-rewrite into master 2020-05-23 08:49:00 +02:00
Showing only changes of commit 2f7e999e49 - Show all commits

View file

@ -661,7 +661,14 @@ public class PublishFormFragment extends BaseFragment implements
}
private void checkAndUploadThumbnail(String filePath, String thumbnailPath, String type) {
if (Helper.isNullOrEmpty(thumbnailPath)) {
boolean thumbnailValid = false;
if (!Helper.isNullOrEmpty(thumbnailPath)) {
File file = new File(thumbnailPath);
// make sure the file exists and it's not an empty file
thumbnailValid = file.exists() && file.length() > 0;
}
if (!thumbnailValid) {
createAndUploadThumbnail(filePath, type);
} else {
uploadThumbnail(thumbnailPath);