Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9ec61ee authored by Steve McKay's avatar Steve McKay
Browse files

Guard against null key events...which can happen.

Bug: 25772143
Change-Id: I0c2665aea25c65b92e6f6c0b1454f1e07112fc9c
parent 8d45f5a6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.DocumentsContract;
import android.provider.DocumentsContract.Document;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.util.Log;
import android.view.KeyEvent;
@@ -83,8 +84,10 @@ public class CreateDirectoryFragment extends DialogFragment {
        editText.setOnEditorActionListener(
                new OnEditorActionListener() {
                    @Override
                    public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
                        if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER
                    public boolean onEditorAction(
                            TextView view, int actionId, @Nullable KeyEvent event) {
                        if (event != null
                                && event.getKeyCode() == KeyEvent.KEYCODE_ENTER
                                && event.hasNoModifiers()) {
                            createDirectory(editText.getText().toString());
                            dialog.dismiss();