diff options
author | Ashwini Munigala <AshwiniM@codeaurora.org> | 2014-05-29 14:58:40 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-05-29 03:20:04 -0700 |
commit | f2d93133756690f746be77b13a45b37cafebfec9 (patch) | |
tree | 821dc4adfd66fe29c9b9bba953f2015944cf573b /src | |
parent | 89b253246e7110e159e3c04aeb96b8e32ffc76fd (diff) | |
download | android_packages_apps_BluetoothExt-f2d93133756690f746be77b13a45b37cafebfec9.tar.gz android_packages_apps_BluetoothExt-f2d93133756690f746be77b13a45b37cafebfec9.tar.bz2 android_packages_apps_BluetoothExt-f2d93133756690f746be77b13a45b37cafebfec9.zip |
FTP: Fix FTP NULL pointer exception for codenomicon tests.
Handle uncaught NULL pointer exceptions for bluetooth
connection socket and transport from BluetoothFtpService.
Change-Id: I045ce0b1b03cb453069c2fd88899236b019c06f7
CRs-fixed: 671855
Diffstat (limited to 'src')
-rw-r--r-- | src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java index 56d0462..9f37533 100644 --- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java +++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpService.java @@ -503,12 +503,20 @@ public class BluetoothFtpService extends Service { mAuth.setCancelled(false); } BluetoothFtpTransport transport; + if(mConnSocket == null){ + Log.i(TAG, "mConnSocket = null"); + throw new IOException("no Connection Socket available"); + } if(isL2capSocket == false) { transport = new BluetoothFtpTransport(mConnSocket,BluetoothFtpTransport.TYPE_RFCOMM); } else { transport = new BluetoothFtpTransport(mConnSocket,BluetoothFtpTransport.TYPE_L2CAP); } + if(transport == null){ + Log.i(TAG, "transport channel = null"); + throw new IOException("no transport channel available"); + } mServerSession = new ServerSession(transport, mFtpServer, mAuth); if (VERBOSE) { |