diff --git a/core/fse.js b/core/fse.js index e6e7a9d18..b956f9646 100644 --- a/core/fse.js +++ b/core/fse.js @@ -167,6 +167,7 @@ exports.FullScreenEditorModule = var newFocusViewId; if (errMsgView) { if (err) { + errMsgView.clearText(); errMsgView.setText(err.message); if (MciViewIds.header.subject === err.view.getId()) { diff --git a/core/system_view_validate.js b/core/system_view_validate.js index 61c52a521..58060aa0f 100644 --- a/core/system_view_validate.js +++ b/core/system_view_validate.js @@ -83,19 +83,23 @@ function validateUserNameOrRealNameExists(data, cb) { } function validateGeneralMailAddressedTo(data, cb) { - // - // Allow any supported addressing: - // - Local username or real name - // - Supported remote flavors such as FTN, email, ... - // - // :TODO: remove hard-coded FTN check here. We need a decent way to register global supported flavors with modules. - const addressedToInfo = getAddressedToInfo(data); + try { + // + // Allow any supported addressing: + // - Local username or real name + // - Supported remote flavors such as FTN, email, ... + // + // :TODO: remove hard-coded FTN check here. We need a decent way to register global supported flavors with modules. + const addressedToInfo = getAddressedToInfo(data); + + if (Message.AddressFlavor.FTN === addressedToInfo.flavor) { + return cb(null); + } - if (Message.AddressFlavor.FTN === addressedToInfo.flavor) { - return cb(null); + return validateUserNameOrRealNameExists(data, cb); + } catch (e) { + return cb(new Error('Invalid address')); } - - return validateUserNameOrRealNameExists(data, cb); } function validateEmailAvail(data, cb) {