From: Włodzimierz Skiba Date: Tue, 25 Apr 2006 12:06:51 +0000 (+0000) Subject: wxTheColourDatabase->Find() can fail. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/81853b98619293be66074d74d2557973c0f3ab21 wxTheColourDatabase->Find() can fail. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 7cc62a7a7f..efd9cad890 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -59,7 +59,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())