diff options
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r-- | generic/tkConfig.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 17a3c28..642a9e5 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -962,8 +962,13 @@ DoObjConfig( if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; newPixels = INT_MIN; - } else if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, + } else if (Tk_GetPixelsFromObj(nullOK ? NULL : interp, tkwin, valuePtr, &newPixels) != TCL_OK) { + if (nullOK && interp) { + Tcl_AppendResult(interp, "expected screen distance or \"\" but got \"", + Tcl_GetString(valuePtr), "\"", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + } return TCL_ERROR; } if (internalPtr != NULL) { |