File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,17 @@ class IsolateErrorIntegration extends Integration {
14
14
15
15
@override
16
16
FutureOr <void > call (Hub hub, SentryOptions options) async {
17
- _receivePort = _createPort (hub, options);
18
-
19
- Isolate .current.addErrorListener (_receivePort! .sendPort);
20
-
17
+ final safeReceivePort = _receivePort = _createPort (hub, options);
18
+ Isolate .current.addErrorListener (safeReceivePort.sendPort);
21
19
options.sdk.addIntegration ('isolateErrorIntegration' );
22
20
}
23
21
24
22
@override
25
23
void close () {
26
24
if (_receivePort != null ) {
27
- _receivePort! .close ();
28
- Isolate .current.removeErrorListener (_receivePort! .sendPort);
25
+ final safeReceivePort = _receivePort! ;
26
+ safeReceivePort.close ();
27
+ Isolate .current.removeErrorListener (safeReceivePort.sendPort);
29
28
}
30
29
}
31
30
}
You can’t perform that action at this time.
0 commit comments