Add NULL guard to the color schemes struct, although the code was safe
neverthless (for now)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37575 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2010-07-19 06:17:52 +00:00
parent 5b3d789879
commit 7071dfc1d1
3 changed files with 25 additions and 21 deletions

View File

@ -243,13 +243,16 @@ AppearancePrefView::MessageReceived(BMessage* msg)
case MSG_COLOR_SCHEMA_CHANGED:
{
color_schema* newSchema = NULL;
msg->FindPointer("color_schema", (void**)&newSchema);
if (msg->FindPointer("color_schema",
(void**)&newSchema) == B_OK) {
if (newSchema == &gCustomSchema)
_EnableCustomColors(true);
else
_EnableCustomColors(false);
_ChangeColorSchema(newSchema);
modified = true;
}
break;
}

View File

@ -38,6 +38,7 @@ const color_schema *gPredefinedSchemas[] = {
&kBlackOnWhite,
&kWhiteOnBlack,
&gCustomSchema,
NULL
};