diff options
author | Emilio López <turl@tuxfamily.org> | 2011-09-27 14:44:05 +0000 |
---|---|---|
committer | Emilio López <turl@tuxfamily.org> | 2011-09-27 14:44:05 +0000 |
commit | b6cf743fe3994eda247c42d933c4256d044e6923 (patch) | |
tree | 1c0b70cf07d55f1ab6ab144c79b74d95da5545ba | |
parent | 04843f5a548bafb380c5d6511c28c5e1ea78d2fc (diff) | |
download | android_packages_apps_Bluetooth-b6cf743fe3994eda247c42d933c4256d044e6923.tar.gz android_packages_apps_Bluetooth-b6cf743fe3994eda247c42d933c4256d044e6923.tar.bz2 android_packages_apps_Bluetooth-b6cf743fe3994eda247c42d933c4256d044e6923.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.java | 8 |
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, |