From 2b5fd2c8a0cbbe244da4c9d3ac6c70119b56b4f9 Mon Sep 17 00:00:00 2001 From: Alicia Date: Thu, 4 Apr 2024 13:40:55 -0600 Subject: [PATCH] Prevent method call on nil object --- app/javascript/controllers/modal_controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/javascript/controllers/modal_controller.js b/app/javascript/controllers/modal_controller.js index f055d648f..0b1736373 100644 --- a/app/javascript/controllers/modal_controller.js +++ b/app/javascript/controllers/modal_controller.js @@ -160,6 +160,8 @@ export default class extends Controller { } displayAppliedIcon() { + if (this.appliedIcon === null) { return } + if (this.modalCheckboxes.some((check) => check.checked === true)) { this.appliedIcon.classList.remove("hidden"); this.appliedIcon.classList.add("inline-block");