Fix issue where engine would panic when attempting to export through a closed connection

This commit is contained in:
ionutboangiu
2022-01-04 17:57:58 +02:00
committed by Dan Christian Bogos
parent 2be78a74c1
commit a23c8218d3

View File

@@ -147,7 +147,9 @@ func (sqlEe *SQLEe) ExportEvent(_ *context.Context, req interface{}, _ string) e
func (sqlEe *SQLEe) Close() (err error) {
sqlEe.Lock()
err = sqlEe.sqldb.Close()
if sqlEe.sqldb != nil {
err = sqlEe.sqldb.Close()
}
sqlEe.db = nil
sqlEe.sqldb = nil
sqlEe.Unlock()