File tree 3 files changed +29
-8
lines changed
3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixes
6
+
7
+ - Fix ` SentryUserInteractionWidget ` throwing when Sentry is not enabled ([ #1363 ] ( https://github.com/getsentry/sentry-dart/pull/1363 ) )
8
+
3
9
## 7.3.0
4
10
5
11
### Features
Original file line number Diff line number Diff line change @@ -251,7 +251,10 @@ class SentryUserInteractionWidget extends StatefulWidget {
251
251
252
252
SentryFlutterOptions ? get _options =>
253
253
// ignore: invalid_use_of_internal_member
254
- _hub.options as SentryFlutterOptions ? ;
254
+ _hub.options is SentryFlutterOptions
255
+ // ignore: invalid_use_of_internal_member
256
+ ? _hub.options as SentryFlutterOptions
257
+ : null ;
255
258
256
259
@override
257
260
StatefulElement createElement () {
Original file line number Diff line number Diff line change 1
1
@TestOn ('vm' )
2
-
3
2
// ignore_for_file: invalid_use_of_internal_member
4
3
5
4
import 'dart:async' ;
@@ -14,13 +13,26 @@ import '../mocks.dart';
14
13
import '../mocks.mocks.dart' ;
15
14
16
15
void main () {
17
- group ('$SentryUserInteractionWidget crumbs' , () {
18
- late Fixture fixture;
19
- setUp (() async {
20
- fixture = Fixture ();
21
- TestWidgetsFlutterBinding .ensureInitialized ();
22
- });
16
+ late Fixture fixture;
17
+ setUp (() async {
18
+ fixture = Fixture ();
19
+ TestWidgetsFlutterBinding .ensureInitialized ();
20
+ });
21
+
22
+ testWidgets (
23
+ '$SentryUserInteractionWidget does not throw cast exception when Sentry is disabled' ,
24
+ (tester) async {
25
+ await tester.runAsync (() async {
26
+ await tester.pumpWidget (
27
+ SentryUserInteractionWidget (
28
+ child: MaterialApp (),
29
+ ),
30
+ );
31
+ });
32
+ },
33
+ );
23
34
35
+ group ('$SentryUserInteractionWidget crumbs' , () {
24
36
testWidgets ('Add crumb for MaterialButton' , (tester) async {
25
37
await tester.runAsync (() async {
26
38
final sut = fixture.getSut ();
You can’t perform that action at this time.
0 commit comments