File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
packages/integrations/src Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ export class Angular implements Integration {
31
31
// eslint-disable-next-line @typescript-eslint/no-explicit-any
32
32
private readonly _angular : any ;
33
33
34
+ /**
35
+ * ngSentry module instance
36
+ */
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ private readonly _module : any ;
39
+
34
40
/**
35
41
* Returns current hub.
36
42
*/
@@ -43,21 +49,28 @@ export class Angular implements Integration {
43
49
public constructor ( options : { angular ?: any } = { } ) {
44
50
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
45
51
this . _angular = options . angular || getGlobalObject < any > ( ) . angular ;
52
+
53
+ if ( ! this . _angular ) {
54
+ logger . error ( 'AngularIntegration is missing an Angular instance' ) ;
55
+ return ;
56
+ }
57
+
58
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
59
+ this . _module = this . _angular . module ( Angular . moduleName , [ ] ) ;
46
60
}
47
61
48
62
/**
49
63
* @inheritDoc
50
64
*/
51
65
public setupOnce ( _ : ( callback : EventProcessor ) => void , getCurrentHub : ( ) => Hub ) : void {
52
- if ( ! this . _angular ) {
53
- logger . error ( 'AngularIntegration is missing an Angular instance' ) ;
66
+ if ( ! this . _module ) {
54
67
return ;
55
68
}
56
69
57
70
this . _getCurrentHub = getCurrentHub ;
58
71
59
72
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
60
- this . _angular . module ( Angular . moduleName , [ ] ) . config ( [
73
+ this . _module . config ( [
61
74
'$provide' ,
62
75
// eslint-disable-next-line @typescript-eslint/no-explicit-any
63
76
( $provide : any ) : void => {
You can’t perform that action at this time.
0 commit comments