From ec17812ce1eed1b2ee019ba988a42b6ccc40d5cb Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 5 May 2011 16:53:56 +0000 Subject: Tolerate NULL interps more completely. --- ChangeLog | 2 +- generic/tclListObj.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ace69a..3371aa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2011-05-05 Don Porter * generic/tclListObj.c: Stop generating string rep of dict when - converting to list. + converting to list. Tolerate NULL interps more completely. 2011-05-03 Don Porter 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); -- cgit v0.12