From 66da13aed6f1eaccda901de626d387f783b93c1c Mon Sep 17 00:00:00 2001 From: Severin Opel Date: Tue, 15 Oct 2019 09:12:12 +0200 Subject: [PATCH] Tried fixing closing error. --- lib/card/card.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/card/card.js b/lib/card/card.js index a046fa6..71ebdd1 100644 --- a/lib/card/card.js +++ b/lib/card/card.js @@ -67,18 +67,13 @@ export default class Card { static close(event) { let context = this.getContext(event.target) - if (context.onClose != null) { - context.onClose() - } else { - this.remove(context) + if (context) { + if (context.onClose != null) { + context.onClose() + } else { + this.remove(context) + } } - - // console.error("Remove") - // let context = this.getContext(event.target) - - // if (context) { - // this.remove(context) - // } else console.error('Could not find context!', event.target) } /**