fix NPE in Automation

This commit is contained in:
Milos Kozak 2019-07-29 23:48:23 +02:00
parent 6daba3b9e7
commit 27ec907611

View file

@ -19,7 +19,7 @@ class ChooseTriggerDialog : DialogFragment() {
private var clickListener: OnClickListener? = null private var clickListener: OnClickListener? = null
interface OnClickListener { interface OnClickListener {
fun onClick(newTriggerObject: Trigger?) fun onClick(newTriggerObject: Trigger)
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
@ -49,7 +49,9 @@ class ChooseTriggerDialog : DialogFragment() {
// OK button // OK button
ok.setOnClickListener { ok.setOnClickListener {
dismiss() dismiss()
clickListener?.onClick(instantiateTrigger()) instantiateTrigger()?.let {
clickListener?.onClick(it)
}
} }
// Cancel button // Cancel button