098ccf83fca73f074dfd27764f9835612b691db6 iodbc/herr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iodbc/herr.c b/iodbc/herr.c index a721bf6..17f8620 100644 --- a/iodbc/herr.c +++ b/iodbc/herr.c @@ -1370,7 +1370,7 @@ SQLGetDiagField_Internal ( { (*(SQLINTEGER *) pDiagInfoPtr) = 0; /* get the number from the driver */ - if (con) + if (con && con->henv) { CALL_UDRIVER(con, Handle, retcode, hproc, unicode_driver, en_GetDiagField, (nHandleType, dhandle, 0, nDiagIdentifier,