Check if the colour string is not empty before trying to pull something out of it. See #15210.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-05-18 21:15:40 +00:00
parent f88cc75eec
commit 59f984375f

View File

@@ -216,7 +216,8 @@ def run():
// Is it a string?
else if (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy)) {
wxString spec = Py2wxString(sipPy);
if (spec.GetChar(0) == '#'
if (!spec.empty()
&& spec.GetChar(0) == '#'
&& (spec.length() == 7 || spec.length() == 9)) { // It's #RRGGBB[AA]
long red, green, blue;
red = green = blue = 0;