We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a2196bd + 80aa027 commit 5f74616Copy full SHA for 5f74616
dart/lib/src/isolate_error_integration.dart
@@ -14,18 +14,17 @@ class IsolateErrorIntegration extends Integration {
14
15
@override
16
FutureOr<void> call(Hub hub, SentryOptions options) async {
17
- _receivePort = _createPort(hub, options);
18
-
19
- Isolate.current.addErrorListener(_receivePort!.sendPort);
20
+ final safeReceivePort = _receivePort = _createPort(hub, options);
+ Isolate.current.addErrorListener(safeReceivePort.sendPort);
21
options.sdk.addIntegration('isolateErrorIntegration');
22
}
23
24
25
void close() {
26
if (_receivePort != null) {
27
- _receivePort!.close();
28
- Isolate.current.removeErrorListener(_receivePort!.sendPort);
+ final safeReceivePort = _receivePort!;
+ safeReceivePort.close();
+ Isolate.current.removeErrorListener(safeReceivePort.sendPort);
29
30
31
0 commit comments