From 81853b98619293be66074d74d2557973c0f3ab21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 25 Apr 2006 12:06:51 +0000 Subject: [PATCH] wxTheColourDatabase->Find() can fail. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/colourcmn.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()) -- 2.45.2