From 59f984375f7b6e3fca3ef999c8804de5d34ffc70 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 18 May 2013 21:15:40 +0000 Subject: [PATCH] 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 --- etg/colour.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etg/colour.py b/etg/colour.py index c4e21020..a6644413 100644 --- a/etg/colour.py +++ b/etg/colour.py @@ -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;