Fix NPE
This commit is contained in:
@@ -67,11 +67,10 @@ class ClientsFragment : Fragment(), MainScope by MainScope.Supervisor() {
|
|||||||
override fun onClick(dialog: DialogInterface?, which: Int) {
|
override fun onClick(dialog: DialogInterface?, which: Int) {
|
||||||
when (which) {
|
when (which) {
|
||||||
DialogInterface.BUTTON_POSITIVE -> {
|
DialogInterface.BUTTON_POSITIVE -> {
|
||||||
|
val newNickname = this@NicknameDialogFragment.dialog!!.findViewById<EditText>(android.R.id.edit).text
|
||||||
MacLookup.abort(arg.mac)
|
MacLookup.abort(arg.mac)
|
||||||
GlobalScope.launch(Dispatchers.Unconfined) {
|
GlobalScope.launch(Dispatchers.Unconfined) {
|
||||||
AppDatabase.instance.clientRecordDao.upsert(arg.mac) {
|
AppDatabase.instance.clientRecordDao.upsert(arg.mac) { nickname = newNickname }
|
||||||
nickname = this@NicknameDialogFragment.dialog!!.findViewById<EditText>(android.R.id.edit).text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DialogInterface.BUTTON_NEUTRAL -> MacLookup.perform(arg.mac, true)
|
DialogInterface.BUTTON_NEUTRAL -> MacLookup.perform(arg.mac, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user