diff options
-rw-r--r-- | generic/tclListObj.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 14b8a14..2929423 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -907,8 +907,11 @@ Tcl_ListObjReplace( } if (objc > LIST_MAX - (numElems - count)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "max length of a Tcl list (%d elements) exceeded", LIST_MAX)); + if (interp != NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length of a Tcl list (%d elements) exceeded", + LIST_MAX)); + } return TCL_ERROR; } isShared = (listRepPtr->refCount > 1); |