Fix CID991252: Possible NULL dereference on scheme name

The color scheme name pointer is dereferenced but was not checked for
NULL value.
This commit is contained in:
Siarzhuk Zharski 2013-04-05 17:13:55 +02:00
parent b249a7ce43
commit 4e17bdd83f

View File

@ -399,6 +399,8 @@ AppearancePrefView::_SetCurrentColorScheme()
}
for (int32 i = 0; i < fColorSchemeField->Menu()->CountItems(); i++) {
if (currentSchemeName == NULL)
break;
BMenuItem* item = fColorSchemeField->Menu()->ItemAt(i);
if (strcmp(item->Label(), currentSchemeName) == 0) {
item->SetMarked(true);