Skip to content

Commit 9434657

Browse files
committed
Update version to 0.3.9.3-STABLE and improve version fetching logic
1 parent f60efe6 commit 9434657

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'fr.sandro642.github'
8-
version = '0.3.9.2-STABLE'
8+
version = '0.3.9.3-STABLE'
99

1010
// Générer une classe de version automatiquement
1111
task generateVersionClass {

src/main/java/fr/sandro642/github/update/RetrieveLastVersion.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class RetrieveLastVersion {
2626
* Fetches the latest version from the GitHub API.
2727
* It sends a GET request to the tags endpoint of the ConnectLib repository
2828
* and retrieves the name of the first tag, which represents the latest version.
29-
* @return
3029
*/
3130
public String fetchVersion() {
3231
try {
@@ -40,7 +39,7 @@ public String fetchVersion() {
4039
Gson gson = new Gson();
4140
JsonArray data = gson.fromJson(response.body(), JsonArray.class);
4241

43-
if (data != null && data.size() > 0) {
42+
if (data != null && !data.isEmpty()) {
4443
JsonObject firstTag = data.get(0).getAsJsonObject();
4544
return firstTag.get("name").getAsString();
4645
} else {

0 commit comments

Comments
 (0)