File tree 2 files changed +12
-6
lines changed 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -211,8 +211,10 @@ export class Query<
211
211
}
212
212
213
213
private clearGcTimeout ( ) {
214
- clearTimeout ( this . gcTimeout )
215
- this . gcTimeout = undefined
214
+ if ( this . gcTimeout ) {
215
+ clearTimeout ( this . gcTimeout )
216
+ this . gcTimeout = undefined
217
+ }
216
218
}
217
219
218
220
private optionalRemove ( ) {
Original file line number Diff line number Diff line change @@ -433,13 +433,17 @@ export class QueryObserver<
433
433
}
434
434
435
435
private clearStaleTimeout ( ) : void {
436
- clearTimeout ( this . staleTimeoutId )
437
- this . staleTimeoutId = undefined
436
+ if ( this . staleTimeoutId ) {
437
+ clearTimeout ( this . staleTimeoutId )
438
+ this . staleTimeoutId = undefined
439
+ }
438
440
}
439
441
440
442
private clearRefetchInterval ( ) : void {
441
- clearInterval ( this . refetchIntervalId )
442
- this . refetchIntervalId = undefined
443
+ if ( this . refetchIntervalId ) {
444
+ clearInterval ( this . refetchIntervalId )
445
+ this . refetchIntervalId = undefined
446
+ }
443
447
}
444
448
445
449
protected createResult (
You can’t perform that action at this time.
0 commit comments