File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -211,8 +211,10 @@ export class Query<
211211 }
212212
213213 private clearGcTimeout ( ) {
214- clearTimeout ( this . gcTimeout )
215- this . gcTimeout = undefined
214+ if ( this . gcTimeout ) {
215+ clearTimeout ( this . gcTimeout )
216+ this . gcTimeout = undefined
217+ }
216218 }
217219
218220 private optionalRemove ( ) {
Original file line number Diff line number Diff line change @@ -433,13 +433,17 @@ export class QueryObserver<
433433 }
434434
435435 private clearStaleTimeout ( ) : void {
436- clearTimeout ( this . staleTimeoutId )
437- this . staleTimeoutId = undefined
436+ if ( this . staleTimeoutId ) {
437+ clearTimeout ( this . staleTimeoutId )
438+ this . staleTimeoutId = undefined
439+ }
438440 }
439441
440442 private clearRefetchInterval ( ) : void {
441- clearInterval ( this . refetchIntervalId )
442- this . refetchIntervalId = undefined
443+ if ( this . refetchIntervalId ) {
444+ clearInterval ( this . refetchIntervalId )
445+ this . refetchIntervalId = undefined
446+ }
443447 }
444448
445449 protected createResult (
You can’t perform that action at this time.
0 commit comments