diff --git a/log/mongo/mongo_log_test.go b/log/mongo/mongo_log_test.go index 720955709..898010244 100644 --- a/log/mongo/mongo_log_test.go +++ b/log/mongo/mongo_log_test.go @@ -110,6 +110,9 @@ func (suite *MongoLogTestSuite) TestMongoLog() { } func (suite *MongoLogTestSuite) TearDownTest() { + if suite.log == nil { // `TearDownTest` is called even if test is skipped + return + } entry := generateEntry(&suite.log.sessionID) _, err := suite.log.db.Database(suite.log.mongoDatabase).Collection(suite.log.messagesLogCollection).DeleteMany(context.Background(), entry) require.Nil(suite.T(), err)