diff --git a/mozilla/mailnews/base/resources/locale/en-US/messenger.properties b/mozilla/mailnews/base/resources/locale/en-US/messenger.properties index 7312c2ff1ac..6108b8df3b5 100644 --- a/mozilla/mailnews/base/resources/locale/en-US/messenger.properties +++ b/mozilla/mailnews/base/resources/locale/en-US/messenger.properties @@ -64,6 +64,7 @@ downloadingMail=Downloading Mail for Offline Use sendingUnsent=Sending Unsent Messages folderExists=A folder with that name already exists. Please enter a different name. +folderCreationFailed=The folder could not be created because the folder name you specified contains an unrecognized character. Please enter a different name and try again. compactingFolder=Compacting folder %S... autoCompactAllFolders=Do you wish to compact all local and offline folders to save disk space? confirmFolderDeletionForFilter=Deleting the folder '%S' will disable its associated filter(s). Are you sure you want to delete the folder? diff --git a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp index 3ec8b1fa0f3..5fe5a180b15 100644 --- a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp @@ -818,8 +818,13 @@ nsMsgLocalMailFolder::CreateSubfolder(const PRUnichar *folderName, nsIMsgWindow return rv; nsXPIDLCString nativeFolderName; - ConvertFromUnicode(nsMsgI18NFileSystemCharset(), nsAutoString(folderName), + rv = ConvertFromUnicode(nsMsgI18NFileSystemCharset(), nsAutoString(folderName), getter_Copies(nativeFolderName)); + if (NS_FAILED(rv) || (nativeFolderName.Length() == 0)) { + ThrowAlertMsg("folderCreationFailed", msgWindow); + // I'm returning this value so the dialog stays up + return NS_MSG_FOLDER_EXISTS; + } nsCAutoString safeFolderName; safeFolderName.Assign(nativeFolderName.get());