summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio López <turl@tuxfamily.org>2011-09-27 14:44:05 +0000
committerEmilio López <turl@tuxfamily.org>2011-09-27 14:44:05 +0000
commitb6cf743fe3994eda247c42d933c4256d044e6923 (patch)
tree1c0b70cf07d55f1ab6ab144c79b74d95da5545ba
parent04843f5a548bafb380c5d6511c28c5e1ea78d2fc (diff)
downloadandroid_packages_apps_Bluetooth-gingerbread-release.tar.gz
android_packages_apps_Bluetooth-gingerbread-release.tar.bz2
android_packages_apps_Bluetooth-gingerbread-release.zip
Bluetooth: Prevent NPE on sharingcm-7.1.0gingerbread-release
This can be caused when an invalid intent (without an action) is sent and handled by this application Change-Id: I34d130381e4b563aa93a7ecb744b51dbee94f9af
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java b/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
index d358b8c22..ed1e251ea 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppLauncherActivity.java
@@ -67,6 +67,14 @@ public class BluetoothOppLauncherActivity extends Activity {
Intent intent = getIntent();
String action = intent.getAction();
+ if (action == null) {
+ /*
+ * If an invalid intent without action is set (example: File Manager)
+ * we should not die because of a NPE
+ */
+ return;
+ }
+
if (action.equals(Intent.ACTION_SEND) || action.equals(Intent.ACTION_SEND_MULTIPLE)) {
/*
* Other application is trying to share a file via Bluetooth,