diff --git a/generic/bson.c b/generic/bson.c index 77e34e7..0aea38a 100644 --- a/generic/bson.c +++ b/generic/bson.c @@ -784,7 +784,9 @@ mongotcl_arraytobson(Tcl_Interp *interp, Tcl_Obj *listObj, char *typeArrayName, // it is there, append element according to the type specified // in the type array - return mongotcl_appendBsonFromObjects(interp, mybson, typeObj, key, valueObj); + if (mongotcl_appendBsonFromObjects(interp, mybson, typeObj, key, valueObj) != TCL_OK) { + return mongotcl_setBsonError (interp, mybson); + } } }