Skip to content

Commit f4b3a2f

Browse files
committed
Handle nullable key events
1 parent ea29b6d commit f4b3a2f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/src/main/kotlin/auth/MinifluxAuthFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MinifluxAuthFragment : Fragment() {
4040
toolbar.setNavigationOnClickListener { findNavController().popBackStack() }
4141

4242
password.setOnEditorActionListener { _, actionId, keyEvent ->
43-
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent.keyCode == KeyEvent.KEYCODE_ENTER) {
43+
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER) {
4444
connect()
4545
return@setOnEditorActionListener true
4646
}

app/src/main/kotlin/auth/NextcloudAuthFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NextcloudAuthFragment : Fragment() {
4040
toolbar.setNavigationOnClickListener { findNavController().popBackStack() }
4141

4242
password.setOnEditorActionListener { _, actionId, keyEvent ->
43-
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent.keyCode == KeyEvent.KEYCODE_ENTER) {
43+
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER) {
4444
connect()
4545
return@setOnEditorActionListener true
4646
}

app/src/main/kotlin/feeds/FeedsFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class FeedsFragment : Fragment() {
121121
val urlView = dialog.findViewById<EditText>(R.id.url)!!
122122

123123
urlView.setOnEditorActionListener { _, actionId, keyEvent ->
124-
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent.keyCode == KeyEvent.KEYCODE_ENTER) {
124+
if (actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER) {
125125
dialog.dismiss()
126126
model.addFeed(urlView.text.toString())
127127
return@setOnEditorActionListener true

0 commit comments

Comments
 (0)