1
1
mirror of https://github.com/Redocly/redoc.git synced 2025-02-27 15:30:34 +03:00

fix: add null check in dispose method ()

This commit is contained in:
William Boman 2018-10-18 13:12:14 +02:00 committed by Roman Hotsiy
parent 7df471b69d
commit 6b7c5b7df3

View File

@ -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();
}
}
/**