Skip to content

Commit

Permalink
fix: crash when checking for updates on a beta version
Browse files Browse the repository at this point in the history
  • Loading branch information
s0llvan committed Nov 23, 2024
1 parent 7f4f844 commit 64acc25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/com/fadcam/ui/AboutFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ private String getAppVersion() {
}

private boolean isUpdateAvailable(String currentVersion, String latestVersion) {
boolean currentIsBeta = currentVersion.contains("beta");

currentVersion = currentVersion.replace("-beta", "");
String[] current = currentVersion.split("\\.");
String[] latest = latestVersion.split("\\.");

Expand All @@ -301,7 +304,7 @@ private boolean isUpdateAvailable(String currentVersion, String latestVersion) {
}
}

return latest.length > current.length;
return latest.length > current.length || (latest.length == current.length && currentIsBeta);
}

private void showLoadingDialog(String message) {
Expand Down

0 comments on commit 64acc25

Please sign in to comment.