]> git.saurik.com Git - wxWidgets.git/commitdiff
wxTheColourDatabase->Find() can fail.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 25 Apr 2006 12:06:51 +0000 (12:06 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 25 Apr 2006 12:06:51 +0000 (12:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/colourcmn.cpp

index 7cc62a7a7f5acf32d57ecea57e9b4049cd1a396e..efd9cad8906106dddc4827b1888c1448a49d0c9b 100644 (file)
@@ -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())