Skip to content

Commit d14d661

Browse files
committed
don't set dbName to null when db close() is called
1 parent 8613819 commit d14d661

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

sqflite/lib/src/sentry_database.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
4444
static const dbNameKey = 'db.name';
4545
@internal
4646
// ignore: public_member_api_docs
47-
String? dbName;
47+
String dbName;
4848

4949
/// ```dart
5050
/// import 'package:sqflite/sqflite.dart';
@@ -82,7 +82,6 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database {
8282
try {
8383
await _database.close();
8484

85-
dbName = null;
8685
span?.status = SpanStatus.ok();
8786
} catch (exception) {
8887
span?.throwable = exception;

sqflite/test/sentry_database_test.dart

-4
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ void main() {
6363

6464
await db.close();
6565

66-
expect(db.dbName, null);
67-
6866
final span = fixture.tracer.children.last;
6967
expect(span.context.operation, 'db');
7068
expect(span.context.description, 'Close DB: $inMemoryDatabasePath');
@@ -163,8 +161,6 @@ void main() {
163161
expect(db.dbName, inMemoryDatabasePath);
164162

165163
await db.close();
166-
167-
expect(db.dbName, null);
168164
});
169165

170166
tearDown(() {

0 commit comments

Comments
 (0)