Bug 1482248 - don't crash on empty file name in nsMsgLocalStoreUtils::nsShouldIgnoreFile.

Tag #1311
This commit is contained in:
Gaming4JC 2019-12-02 22:14:49 -05:00 committed by Roy Tam
commit 0c908247d6

View file

@ -28,6 +28,9 @@ nsMsgLocalStoreUtils::AddDirectorySeparator(nsIFile *path)
bool
nsMsgLocalStoreUtils::nsShouldIgnoreFile(nsAString& name)
{
if (name.IsEmpty())
return true;
char16_t firstChar = name.First();
if (firstChar == '.' || firstChar == '#' ||
name.CharAt(name.Length() - 1) == '~')