From 7cdd184197c9d090d872d27d08eb74f7a46f80d7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 23 Nov 2014 02:06:49 -0800 Subject: [PATCH] Fix null pointer exception on ATV emulator --- .../java/com/limelight/preferences/AddComputerManually.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index 834c3348..9e8b1584 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -142,8 +142,9 @@ public class AddComputerManually extends Activity { @Override public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) { if (actionId == EditorInfo.IME_ACTION_DONE || - keyEvent.getAction() == KeyEvent.ACTION_DOWN && - keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER) { + (keyEvent != null && + keyEvent.getAction() == KeyEvent.ACTION_DOWN && + keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { if (hostText.getText().length() == 0) { Toast.makeText(AddComputerManually.this, getResources().getString(R.string.addpc_enter_ip), Toast.LENGTH_LONG).show(); return true;