X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b5d2431fc188c03bd43ef69b5ad3197646c9289..d5da0ce7cb746318511b3974b7882c72c0de45e2:/src/common/colourcmn.cpp diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 7cc62a7a7f..4c7d7c088f 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -19,9 +19,11 @@ #include "wx/colour.h" -#include "wx/gdicmn.h" -#include "wx/log.h" +#ifndef WX_PRECOMP + #include "wx/log.h" +#endif +#include "wx/gdicmn.h" // ============================================================================ @@ -59,7 +61,10 @@ bool wxColourBase::FromString(const wxChar *str) // because this place can be called from constructor // and 'this' could not be available yet wxColour clr = wxTheColourDatabase->Find(str); - Set((unsigned char)clr.Red(), (unsigned char)clr.Green(), (unsigned char)clr.Blue()); + if (clr.Ok()) + Set((unsigned char)clr.Red(), + (unsigned char)clr.Green(), + (unsigned char)clr.Blue()); } if (Ok())