summaryrefslogtreecommitdiffstats
path: root/generic/tkOldConfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkOldConfig.c')
-rw-r--r--generic/tkOldConfig.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 70e0152..9ee2a14 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkOldConfig.c,v 1.5 1999/12/14 06:52:30 hobbs Exp $
+ * RCS: @(#) $Id: tkOldConfig.c,v 1.6 2000/03/07 00:09:08 ericm Exp $
*/
#include "tkPort.h"
@@ -90,6 +90,15 @@ Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags)
int hateFlags; /* If a spec contains any bits here, it's
* not considered. */
+ if (tkwin == NULL) {
+ /*
+ * Either we're not really in Tk, or the main window was destroyed and
+ * we're on our way out of the application
+ */
+ Tcl_AppendResult(interp, "NULL main window", (char *)NULL);
+ return TCL_ERROR;
+ }
+
needFlags = flags & ~(TK_CONFIG_USER_BIT - 1);
if (Tk_Depth(tkwin) <= 1) {
hateFlags = TK_CONFIG_COLOR_ONLY;