Error handler for start dialog from adb command

This CL added null check for the case that dialog
is started from adb command.

Bug: 129783237
Test: manually
Change-Id: I47d47cb5ddfe3487e2d616d1cf2ed08bd11d215d
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index 060c174..927b1b6 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -65,6 +65,11 @@
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         Intent intent = getIntent();
+        if (intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE) == null) {
+            // Error handler for the case that dialog is started from adb command.
+            finish();
+            return;
+        }
         mBluetoothPairingController = new BluetoothPairingController(intent, this);
         // build the dialog fragment
         boolean fragmentFound = true;