From 290ba7c1ae084e9bbc3e5bb3a6e8d7c6207adbab Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Wed, 13 Oct 2010 13:33:32 -0700 Subject: [PATCH] Fix NPE in BT Settings launch from a shortcut. Bug: 3089335 --- src/com/android/settings/bluetooth/BluetoothSettings.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index 88d1e83b4ba..0de3bfa96ad 100644 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -41,11 +41,10 @@ import android.preference.CheckBoxPreference; import android.preference.Preference; import android.preference.PreferenceScreen; import android.text.TextUtils; -import android.util.Log; import android.view.ContextMenu; -import android.view.ContextMenu.ContextMenuInfo; import android.view.MenuItem; import android.view.View; +import android.view.ContextMenu.ContextMenuInfo; import android.widget.AdapterView.AdapterContextMenuInfo; import java.util.List; @@ -148,7 +147,8 @@ public class BluetoothSettings extends SettingsPreferenceFragment final Intent intent = activity.getIntent(); // This additional argument comes from PreferenceScreen (See TetherSettings.java). - String action = getArguments().getString(ACTION); + Bundle args = getArguments(); + String action = args != null ? args.getString(ACTION) : null; if (TextUtils.isEmpty(action)) { action = intent.getAction(); }