diff --git a/dlls/mysqlx/threading.cpp b/dlls/mysqlx/threading.cpp index 7bdf6cce..ddbd2617 100644 --- a/dlls/mysqlx/threading.cpp +++ b/dlls/mysqlx/threading.cpp @@ -175,7 +175,10 @@ void MysqlThread::RunThread(IThreadHandle *pHandle) m_qrInfo.amxinfo.pQuery = pQuery; m_qrInfo.amxinfo.info.rs = &m_atomicResult; } else { - pQuery->FreeHandle(); + if (pQuery) + { + pQuery->FreeHandle(); + } pQuery = NULL; }