diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index fd275b19f77..d6e17b3b5e2 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -336,6 +336,11 @@ innobase_release_temporary_latches(
 /*===============================*/
         THD *thd)
 {
+	if (!innodb_inited) {
+		
+		return;
+	}
+
   trx_t *trx= (trx_t*) thd->ha_data[innobase_hton.slot];
   if (trx)
         innobase_release_stat_resources(trx);