diff --git a/src/ydb.c b/src/ydb.c index c60a9539f8f..8c09527c3cd 100644 --- a/src/ydb.c +++ b/src/ydb.c @@ -486,7 +486,8 @@ int __toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, db->i->open_mode = mode; r = brt_open(db->i->brt, db->i->full_fname, dbname, flags & DB_CREATE, - db->dbenv->i->cachetable, txn->i->tokutxn); + db->dbenv->i->cachetable, + txn ? txn->i->tokutxn : NULL_TXN); if (r != 0) goto error_cleanup;