From ca0b9a0e5e9b05a974d6fde0f88b0d3388228a45 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Wed, 10 Jul 2024 19:23:24 +0200 Subject: [PATCH] Upgrade project, Fix NPE in search and when adding codes --- .idea/deploymentTargetDropDown.xml | 4 ++-- .idea/vcs.xml | 2 +- .../java/com/cringe_studios/code_guard/icon/IconPack.java | 2 ++ .../com/cringe_studios/code_guard/otplist/OTPListAdapter.java | 4 ++-- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 981f604..5aea5be 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -10,12 +10,12 @@ - + - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/src/main/java/com/cringe_studios/code_guard/icon/IconPack.java b/app/src/main/java/com/cringe_studios/code_guard/icon/IconPack.java index 013561c..56439bf 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/icon/IconPack.java +++ b/app/src/main/java/com/cringe_studios/code_guard/icon/IconPack.java @@ -19,6 +19,8 @@ public class IconPack { } public Icon findIconForIssuer(String issuer) { + if(issuer == null) return null; + for(Icon icon : icons) { for(String i : icon.getMetadata().getIssuer()) { if(issuer.equalsIgnoreCase(i)) { diff --git a/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java b/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java index ae25528..13570f0 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java +++ b/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java @@ -245,8 +245,8 @@ public class OTPListAdapter extends RecyclerView.Adapter { List filtered = new ArrayList<>(); for(OTPData d : allOTPs) { - if(d.getName().toLowerCase().contains(query) - || d.getIssuer().toLowerCase().contains(query)) filtered.add(d); + if((d.getName() != null && d.getName().toLowerCase().contains(query)) + || (d.getIssuer() != null && d.getIssuer().toLowerCase().contains(query))) filtered.add(d); } filteredItems = filtered; diff --git a/build.gradle b/build.gradle index 89f38df..603b6eb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.3.2' apply false - id 'com.android.library' version '8.3.2' apply false + id 'com.android.application' version '8.5.0' apply false + id 'com.android.library' version '8.5.0' apply false id 'com.google.protobuf' version '0.9.3' apply false } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e471291..c175cb4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Jun 17 16:15:03 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists