summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-05-05 16:53:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-05-05 16:53:56 (GMT)
commitec17812ce1eed1b2ee019ba988a42b6ccc40d5cb (patch)
treea48fc074188493920528c19d36513ad69a510825 /generic/tclListObj.c
parent46f4c7867d2ecf64019aced47edec8f67f244152 (diff)
downloadtcl-ec17812ce1eed1b2ee019ba988a42b6ccc40d5cb.zip
tcl-ec17812ce1eed1b2ee019ba988a42b6ccc40d5cb.tar.gz
tcl-ec17812ce1eed1b2ee019ba988a42b6ccc40d5cb.tar.bz2
Tolerate NULL interps more completely.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index a9c986b..c4061b3 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -1400,8 +1400,10 @@ TclLsetFlat(
if (index < 0 || index >= elemCount) {
/* ...the index points outside the sublist. */
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj("list index out of range", -1));
+ if (interp != NULL) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("list index out of range", -1));
+ }
break;
}
@@ -1557,8 +1559,10 @@ TclListObjSetElement(
(void) TclGetStringFromObj(listPtr, &length);
}
if (!length) {
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj("list index out of range", -1));
+ if (interp != NULL) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("list index out of range", -1));
+ }
return TCL_ERROR;
}
result = SetListFromAny(interp, listPtr);