From ca5210cfb2650ad81c63138c84a6101315f29535 Mon Sep 17 00:00:00 2001 From: ligi Date: Tue, 24 May 2016 09:44:59 +0200 Subject: [PATCH] Address lint issues --- .../main/java/org/ligi/passandroid/ui/PassMenuOptions.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java b/android/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java index 421bc5fb..2bb0bfb2 100644 --- a/android/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java +++ b/android/src/main/java/org/ligi/passandroid/ui/PassMenuOptions.java @@ -54,7 +54,8 @@ public class PassMenuOptions { final View sourceDeleteCheckBoxView = LayoutInflater.from(activity).inflate(R.layout.delete_dialog_layout, null); final CheckBox sourceDeleteCheckBox = (CheckBox) sourceDeleteCheckBoxView.findViewById(R.id.sourceDeleteCheckbox); - if (pass.getSource(passStore) != null && pass.getSource(passStore).startsWith("file://")) { + final String source = pass.getSource(passStore); + if (source != null && source.startsWith("file://")) { sourceDeleteCheckBox.setText(activity.getString(R.string.dialog_delete_confirm_delete_source_checkbox)); builder.setView(sourceDeleteCheckBoxView); @@ -65,7 +66,8 @@ public class PassMenuOptions { @Override public void onClick(DialogInterface dialog, int which) { if (sourceDeleteCheckBox.isChecked()) { - new File(pass.getSource(passStore).replace("file://", "")).delete(); + //noinspection ConstantConditions - we are sure source is not null - as only then sourceDeleteCheckBox + new File(source.replace("file://", "")).delete(); } passStore.deletePassWithId(pass.getId()); if (activity instanceof PassViewActivityBase) {