diff options
Diffstat (limited to 'Modules/stdwinmodule.c')
-rw-r--r-- | Modules/stdwinmodule.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/stdwinmodule.c b/Modules/stdwinmodule.c index 62e9b47..77ba6ec 100644 --- a/Modules/stdwinmodule.c +++ b/Modules/stdwinmodule.c @@ -2119,9 +2119,17 @@ stdwin_fetchcolor(self, args) object *args; { char *colorname; + COLOR color; if (!getstrarg(args, &colorname)) return NULL; - return newintobject((long)wfetchcolor(colorname)); + color = wfetchcolor(colorname); +#ifdef BADCOLOR + if (color == BADCOLOR) { + err_setstr(StdwinError, "color name not found"); + return NULL; + } +#endif + return newintobject((long)color); } static object * |