Skip to content

Commit

Permalink
Make sure a Tcl error string gets set if mongotcl_cmdNameObjToBson fa…
Browse files Browse the repository at this point in the history
…ils.

BUGZID:
  • Loading branch information
lehenbauer committed Feb 13, 2014
1 parent 67c9d5e commit e1b69e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generic/bson.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ mongotcl_cmdNameObjToBson (Tcl_Interp *interp, Tcl_Obj *commandNameObj, bson **b
Tcl_CmdInfo cmdInfo;

if (!Tcl_GetCommandInfo (interp, Tcl_GetString(commandNameObj), &cmdInfo)) {
return TCL_ERROR;
goto lookup_error;
}

if (cmdInfo.objClientData == NULL || ((mongotcl_bsonClientData *)cmdInfo.objClientData)->bson_magic != MONGOTCL_BSON_MAGIC) {
lookup_error:
Tcl_AppendResult (interp, "Error: '", Tcl_GetString (commandNameObj), "' is not a bson object", NULL);
return TCL_ERROR;
}
Expand Down

0 comments on commit e1b69e4

Please sign in to comment.