From 3d77f119d308cf09fbe325805358310f715eea04 Mon Sep 17 00:00:00 2001 From: jung eunjung Date: Sun, 22 Jan 2023 04:09:05 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20add=20:=20lateinit=20listener=20nul?= =?UTF-8?q?l=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shootit/greme/ui/custom/InterestButton.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/shootit/greme/ui/custom/InterestButton.kt b/app/src/main/java/com/shootit/greme/ui/custom/InterestButton.kt index 2d77cb5..1a45918 100644 --- a/app/src/main/java/com/shootit/greme/ui/custom/InterestButton.kt +++ b/app/src/main/java/com/shootit/greme/ui/custom/InterestButton.kt @@ -46,7 +46,9 @@ class InterestButton : ConstraintLayout { true -> binding.iconBg.background.setTint(ContextCompat.getColor(context, R.color.icon_bg_selected)) else -> binding.iconBg.background.setTint(ContextCompat.getColor(context, R.color.icon_bg_unSelected)) } - listener?.interestButtonOnClick(binding.description.text.toString(), interestIsSelected) + if (this::listener.isInitialized) { + listener.interestButtonOnClick(binding.description.text.toString(), interestIsSelected) + } } }