Index: generic/nsf.c =================================================================== diff -u -r9f90d6b1ce7bfabedbda9470cb71fa368a64531c -r1a7f8ba5a64328222a30016f19769f6595a74ace --- generic/nsf.c (.../nsf.c) (revision 9f90d6b1ce7bfabedbda9470cb71fa368a64531c) +++ generic/nsf.c (.../nsf.c) (revision 1a7f8ba5a64328222a30016f19769f6595a74ace) @@ -28119,19 +28119,24 @@ normalArgs = i-1; /* - * Get the init string; do it once, outside the loop. + * Get the init string; do it once, outside the loop. If initString is not + * obtainable (i.e. not configured in the object system), don't call the + * "init" method in the loop. */ if (i < objc) { NsfObjectSystem *osPtr = GetObjectSystem(object); Tcl_Obj *initObj = osPtr->methods[NSF_o_init_idx]; + if (initObj != NULL) { initString = ObjStr(initObj); + assert(initString != NULL); } + } + for( ; i < objc; argc = nextArgc, argv = nextArgv, methodName = nextMethodName) { - assert(initString != NULL); Tcl_ResetResult(interp); switch (isdasharg) { @@ -28147,9 +28152,11 @@ break; } } - result = CallConfigureMethod(interp, object, initString, methodName, argc+1, objv+i+1); - if (unlikely(result != TCL_OK)) { - return result; + if (initString != NULL) { + result = CallConfigureMethod(interp, object, initString, methodName, argc+1, objv+i+1); + if (unlikely(result != TCL_OK)) { + return result; + } } i += argc; break; @@ -28165,9 +28172,11 @@ nextArgv = NULL; nextArgc = 0; } - result = CallConfigureMethod(interp, object, initString, methodName, argc+1, argv+1); - if (unlikely(result != TCL_OK)) { - return result; + if (initString != NULL) { + result = CallConfigureMethod(interp, object, initString, methodName, argc+1, argv+1); + if (unlikely(result != TCL_OK)) { + return result; + } } break; }