aboutsummaryrefslogtreecommitdiffstats
path: root/android-mobile/src/org/subsurfacedivelog/mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-10 21:43:50 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-11 11:14:22 -0700
commit9f94aaf450200d1aab1dd7aff43cd8cf58de57a5 (patch)
tree247dce3dd2f39babe4d09ba47e54636c6056bdd3 /android-mobile/src/org/subsurfacedivelog/mobile
parentfd498a90db622d3093bce450d3e91ef73ba8b3f3 (diff)
downloadsubsurface-9f94aaf450200d1aab1dd7aff43cd8cf58de57a5.tar.gz
Whitespace cleanup, extra braces, and null checks
Thanks to Lubomir for the review. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'android-mobile/src/org/subsurfacedivelog/mobile')
-rw-r--r--android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
index 66f5c1b0e..4c5bc576b 100644
--- a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
+++ b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
@@ -53,6 +53,10 @@ public class SubsurfaceMobileActivity extends QtActivity
public void onNewIntent(Intent intent) {
Log.i(TAG + " onNewIntent", intent.getAction());
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
+ if (device == null) {
+ Log.i(TAG + " onNewIntent", "null device");
+ return;
+ }
Log.i(TAG + " onNewIntent toString", device.toString());
super.onNewIntent(intent);
setIntent(intent);
@@ -78,8 +82,16 @@ public class SubsurfaceMobileActivity extends QtActivity
private void processIntent() {
Intent intent = getIntent();
+ if (intent == null) {
+ Log.i(TAG + " processIntent", "intent is null");
+ return;
+ }
Log.i(TAG + " processIntent", intent.getAction());
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
+ if (device == null) {
+ Log.i(TAG + " processIntent", "null device");
+ return;
+ }
Log.i(TAG + " processIntent device name", device.getDeviceName());
setDeviceString(device.toString());
} // processIntent