We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 04be0cf + 9434657 commit db1eb51Copy full SHA for db1eb51
1 file changed
src/main/java/fr/sandro642/github/update/RetrieveLastVersion.java
@@ -26,7 +26,6 @@ public class RetrieveLastVersion {
26
* Fetches the latest version from the GitHub API.
27
* It sends a GET request to the tags endpoint of the ConnectLib repository
28
* and retrieves the name of the first tag, which represents the latest version.
29
- * @return
30
*/
31
public String fetchVersion() {
32
try {
@@ -40,7 +39,7 @@ public String fetchVersion() {
40
39
Gson gson = new Gson();
41
JsonArray data = gson.fromJson(response.body(), JsonArray.class);
42
43
- if (data != null && data.size() > 0) {
+ if (data != null && !data.isEmpty()) {
44
JsonObject firstTag = data.get(0).getAsJsonObject();
45
return firstTag.get("name").getAsString();
46
} else {
0 commit comments