From 3c18596440221c527ba8785ff16ac4b1a19afbc4 Mon Sep 17 00:00:00 2001 From: Wahid Gazzah Date: Wed, 3 Jul 2019 11:41:52 +0200 Subject: [PATCH] Update modal.component.ts Fix issue 217 --- projects/ng2-bs3-modal/src/modal/modal.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/ng2-bs3-modal/src/modal/modal.component.ts b/projects/ng2-bs3-modal/src/modal/modal.component.ts index be44c71..24225f5 100644 --- a/projects/ng2-bs3-modal/src/modal/modal.component.ts +++ b/projects/ng2-bs3-modal/src/modal/modal.component.ts @@ -299,12 +299,13 @@ export class BsModalComponent implements OnInit, AfterViewInit, OnChanges, OnDes backdrop = true; } - - if (options.backdrop !== undefined) { - this.options.backdrop = backdrop; - } - if (options.keyboard !== undefined) { - this.options.keyboard = options.keyboard; + if (this.options) { + if (options.backdrop !== undefined) { + this.options.backdrop = backdrop; + } + if (options.keyboard !== undefined) { + this.options.keyboard = options.keyboard; + } } }