From 77f16816da35697ef60dfafe1df45cf300ef15ec Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Thu, 17 Jul 2014 10:09:35 +0000 Subject: [PATCH] Check properties values git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1611311 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/ofbiz/service/mail/JavaMailContainer.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java b/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java index 436ab1461f..995e45611c 100644 --- a/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java +++ b/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java @@ -239,12 +239,20 @@ public class JavaMailContainer implements Container { int portProps = 0; String portStr = props.getProperty("mail." + protocol + ".port"); if (!UtilValidate.isEmpty(portStr)) { - portProps = Integer.valueOf(portStr); + try { + portProps = Integer.valueOf(portStr); + } catch (NumberFormatException e) { + Debug.logError("The port given in property mail." + protocol + ".port is wrong, please check", module); + } } if (portProps == 0) { portStr = props.getProperty("mail.port"); if (!UtilValidate.isEmpty(portStr)) { - portProps = Integer.valueOf(props.getProperty("mail.port")); + try { + portProps = Integer.valueOf(props.getProperty("mail.port")); + } catch (NumberFormatException e) { + Debug.logError("The port given in property mail.port is wrong, please check", module); + } } } // override the port if have found one.