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
+4 -1
View File
@@ -243,13 +243,16 @@ AppearancePrefView::MessageReceived(BMessage* msg)
case MSG_COLOR_SCHEMA_CHANGED: case MSG_COLOR_SCHEMA_CHANGED:
{ {
color_schema* newSchema = NULL; color_schema* newSchema = NULL;
msg->FindPointer("color_schema", (void**)&newSchema); if (msg->FindPointer("color_schema",
(void**)&newSchema) == B_OK) {
if (newSchema == &gCustomSchema) if (newSchema == &gCustomSchema)
_EnableCustomColors(true); _EnableCustomColors(true);
else else
_EnableCustomColors(false); _EnableCustomColors(false);
_ChangeColorSchema(newSchema); _ChangeColorSchema(newSchema);
modified = true; modified = true;
}
break; break;
} }
+1
View File
@@ -38,6 +38,7 @@ const color_schema *gPredefinedSchemas[] = {
&kBlackOnWhite, &kBlackOnWhite,
&kWhiteOnBlack, &kWhiteOnBlack,
&gCustomSchema, &gCustomSchema,
NULL
}; };