Review comments #3
(cherry picked from commit 3d51aa8deaae85daa937ed06d23533b9efd940e1)
diff --git a/core/sql/cli/Globals.cpp b/core/sql/cli/Globals.cpp
index e07d08a..a3e9a75 100644
--- a/core/sql/cli/Globals.cpp
+++ b/core/sql/cli/Globals.cpp
@@ -620,7 +620,8 @@
            newContext == tsCurrentContextMap->context_)
      return 0;
   if (newContext == defaultContext_)
-    tsCurrentContextMap = NULL;
+    if (tsCurrentContextMap)
+      tsCurrentContextMap->context_ = NULL;
   retcode = currContext()->getTransaction()->suspendTransaction();
   if (retcode != 0)
      return retcode;