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; + } } }