@@ -128,10 +128,12 @@ export class InternalEnforcer extends CoreEnforcer {
128
128
}
129
129
130
130
if ( useWatcher ) {
131
- if ( this . watcher && this . autoNotifyWatcher ) {
131
+ if ( this . autoNotifyWatcher ) {
132
132
// In fact I think it should wait for the respond, but they implement add_policy() like this
133
133
// error intentionally ignored
134
- this . watcher . update ( ) ;
134
+ if ( this . watcher ) {
135
+ this . watcher . update ( ) ;
136
+ }
135
137
}
136
138
}
137
139
@@ -163,7 +165,7 @@ export class InternalEnforcer extends CoreEnforcer {
163
165
}
164
166
165
167
if ( useWatcher ) {
166
- if ( this . watcher && this . autoNotifyWatcher ) {
168
+ if ( this . autoNotifyWatcher ) {
167
169
// error intentionally ignored
168
170
if ( this . watcherEx ) {
169
171
this . watcherEx . updateForRemovePolicy ( sec , ptype , ...rule ) ;
@@ -203,7 +205,7 @@ export class InternalEnforcer extends CoreEnforcer {
203
205
}
204
206
205
207
if ( useWatcher ) {
206
- if ( this . watcher && this . autoNotifyWatcher ) {
208
+ if ( this . autoNotifyWatcher ) {
207
209
// error intentionally ignored
208
210
if ( this . watcherEx ) {
209
211
this . watcherEx . updateForRemovePolicies ( sec , ptype , ...rules ) ;
@@ -241,7 +243,7 @@ export class InternalEnforcer extends CoreEnforcer {
241
243
}
242
244
243
245
if ( useWatcher ) {
244
- if ( this . watcher && this . autoNotifyWatcher ) {
246
+ if ( this . autoNotifyWatcher ) {
245
247
// error intentionally ignored
246
248
if ( this . watcherEx ) {
247
249
this . watcherEx . updateForRemoveFilteredPolicy ( sec , ptype , fieldIndex , ...fieldValues ) ;
0 commit comments