Skip to content

Commit db1eb51

Browse files
authored
Merge branch 'main' into feature/web-impl
2 parents 04be0cf + 9434657 commit db1eb51

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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)