mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-28 03:36:45 +02:00
Image editor: error handling
This commit is contained in:
@@ -40,6 +40,7 @@ import com.canhub.cropper.CropImageView;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class FragmentDialogEditImage extends FragmentDialogBase {
|
||||
@@ -132,7 +133,8 @@ public class FragmentDialogEditImage extends FragmentDialogBase {
|
||||
if (!TextUtils.isEmpty(ext) && !ext.equalsIgnoreCase("png")) {
|
||||
File old = attachment.getFile(context);
|
||||
attachment.name = attachment.name.substring(0, index) + ".png";
|
||||
old.renameTo(attachment.getFile(context));
|
||||
if (!old.renameTo(attachment.getFile(context)))
|
||||
throw new IOException("Error renaming " + file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user