mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
service/AppStore: add null check in dispose method
This commit is contained in:
parent
ef520eacfa
commit
87cd5ac9ec
|
@ -1,4 +1,4 @@
|
|||
import { observe } from 'mobx';
|
||||
import { observe, Lambda } from 'mobx';
|
||||
|
||||
import { OpenAPISpec } from '../types';
|
||||
import { loadAndBundleSpec } from '../utils/loadAndBundleSpec';
|
||||
|
@ -58,7 +58,7 @@ export class AppStore {
|
|||
marker = new MarkerService();
|
||||
|
||||
private scroll: ScrollService;
|
||||
private disposer;
|
||||
private disposer: Lambda | null = null;
|
||||
|
||||
constructor(
|
||||
spec: OpenAPISpec,
|
||||
|
@ -96,7 +96,9 @@ export class AppStore {
|
|||
dispose() {
|
||||
this.scroll.dispose();
|
||||
this.menu.dispose();
|
||||
this.disposer();
|
||||
if (this.disposer != null) {
|
||||
this.disposer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user