fix NPE in Automation
This commit is contained in:
parent
6daba3b9e7
commit
27ec907611
1 changed files with 4 additions and 2 deletions
|
@ -19,7 +19,7 @@ class ChooseTriggerDialog : DialogFragment() {
|
|||
private var clickListener: OnClickListener? = null
|
||||
|
||||
interface OnClickListener {
|
||||
fun onClick(newTriggerObject: Trigger?)
|
||||
fun onClick(newTriggerObject: Trigger)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
|
@ -49,7 +49,9 @@ class ChooseTriggerDialog : DialogFragment() {
|
|||
// OK button
|
||||
ok.setOnClickListener {
|
||||
dismiss()
|
||||
clickListener?.onClick(instantiateTrigger())
|
||||
instantiateTrigger()?.let {
|
||||
clickListener?.onClick(it)
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel button
|
||||
|
|
Loading…
Reference in a new issue