mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 04:02:10 +01:00
Add error message if unable to generate img
This commit is contained in:
parent
f016d682c5
commit
b8a2240982
@ -82,6 +82,7 @@ public class SendMailSSL {
|
||||
// Generate an image ?
|
||||
File file = null;
|
||||
if (Settings.generateImage) {
|
||||
try {
|
||||
ImageGenerator gen = new ImageGenerator(newPass);
|
||||
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||
@ -90,6 +91,9 @@ public class SendMailSSL {
|
||||
messageBodyPart.setDataHandler(new DataHandler(source));
|
||||
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail);
|
||||
}
|
||||
}
|
||||
|
||||
message.setContent(multipart);
|
||||
|
Loading…
Reference in New Issue
Block a user