Skip to content

Commit 9ef2bdd

Browse files
committed
Fix NullPointerException in case Bluetooth Auto-Type is disabled
1 parent 9629b14 commit 9ef2bdd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

authorizer/src/main/java/net/tjado/passwdsafe/PasswdSafeRecordBasicFragment.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,13 @@ public boolean onLongClick(View view) {
266266
LinearLayout autotypeBluetoothRow = root.findViewById(R.id.autotype_bt_row);
267267
LinearLayout autotypeSettingsRow = root.findViewById(R.id.autotype_settings_row);
268268

269+
itsAutoTypeBluetoothUsername = (Button)root.findViewById(R.id.autotype_bt_username);
270+
itsAutoTypeBluetoothPassword = (Button)root.findViewById(R.id.autotype_bt_password);
271+
itsAutoTypeBluetoothOtp = (Button)root.findViewById(R.id.autotype_bt_otp);
272+
itsAutoTypeBluetoothCredential = (Button)root.findViewById(R.id.autotype_bt_credentials);
273+
269274
if (Preferences.getAutoTypeBluetoothEnabled(prefs) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
270275
// Auto-Type Bluetooth username
271-
itsAutoTypeBluetoothUsername = (Button)root.findViewById(R.id.autotype_bt_username);
272276
itsAutoTypeBluetoothUsername.setOnClickListener(new View.OnClickListener() {
273277
@Override
274278
public void onClick(View view) {
@@ -284,7 +288,6 @@ public boolean onLongClick(View view) {
284288
});
285289

286290
// Auto-Type Bluetooth password
287-
itsAutoTypeBluetoothPassword = (Button)root.findViewById(R.id.autotype_bt_password);
288291
itsAutoTypeBluetoothPassword.setOnClickListener(new View.OnClickListener() {
289292
@Override
290293
public void onClick(View view) {
@@ -300,7 +303,6 @@ public boolean onLongClick(View view) {
300303
});
301304

302305
// Auto-Type Bluetooth OTP
303-
itsAutoTypeBluetoothOtp = (Button)root.findViewById(R.id.autotype_bt_otp);
304306
itsAutoTypeBluetoothOtp.setOnClickListener(new View.OnClickListener() {
305307
@Override
306308
public void onClick(View view) {
@@ -316,7 +318,6 @@ public boolean onLongClick(View view) {
316318
});
317319

318320
// Auto-Type Bluetooth credentials
319-
itsAutoTypeBluetoothCredential = (Button)root.findViewById(R.id.autotype_bt_credentials);
320321
itsAutoTypeBluetoothCredential.setOnClickListener(new View.OnClickListener() {
321322
@Override
322323
public void onClick(View view) {

0 commit comments

Comments
 (0)