mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 08:21:23 +00:00
add return null if latest release not found
This commit is contained in:
@@ -300,7 +300,11 @@ public class GHRepository extends GHObject {
|
||||
}
|
||||
|
||||
public GHRelease getLatestRelease() throws IOException {
|
||||
return root.retrieve().to(getApiTailUrl("releases/latest"), GHRelease.class).wrap(this);
|
||||
try {
|
||||
return root.retrieve().to(getApiTailUrl("releases/latest"), GHRelease.class).wrap(this);
|
||||
} catch (FileNotFoundException e) {
|
||||
return null; // no latest release
|
||||
}
|
||||
}
|
||||
|
||||
public PagedIterable<GHRelease> listReleases() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user