From 996e7ddaf600267ed19bade5e3fb089bd5aa7d9a Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Wed, 19 Feb 2014 18:39:09 +0000 Subject: [PATCH] Fix error in mongotcl_arraytobson where it would return after any field found in the data types array. (It should process all elements of the data array before returning.) BUGZID: --- generic/bson.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); + } } }