[EU-FOSSA] Fix crash issue of User Define dialog while deleting a unallocated entry

This commit is contained in:
Don HO 2019-03-22 09:03:59 +01:00
parent 32f1dafe77
commit f7d92eb992
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -2622,10 +2622,14 @@ std::pair<unsigned char, unsigned char> NppParameters::feedUserLang(TiXmlNode *n
const TCHAR *name = (childNode->ToElement())->Attribute(TEXT("name"));
const TCHAR *ext = (childNode->ToElement())->Attribute(TEXT("ext"));
const TCHAR *udlVersion = (childNode->ToElement())->Attribute(TEXT("udlVersion"));
try {
if (!name || !name[0] || !ext)
throw std::runtime_error("NppParameters::feedUserLang : UserLang name is missing");
if (!name || !name[0] || !ext)
{
// UserLang name is missing, just ignore this entry
continue;
}
try {
if (!udlVersion)
_userLangArray[_nbUserLang] = new UserLangContainer(name, ext, TEXT(""));
else