Skip to content

Commit a2129b2

Browse files
Gregory PettGregory Pett
Gregory Pett
authored and
Gregory Pett
committed
handle nulls for publishedAT
1 parent 897fff4 commit a2129b2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.kohsuke</groupId>
44
<artifactId>cortexapps-github-api</artifactId>
5-
<version>1.315</version>
5+
<version>1.316</version>
66
<name>GitHub API for Java</name>
77
<url>https://github-api.kohsuke.org/</url>
88
<description>GitHub API for Java</description>

src/main/java/org/kohsuke/github/GHRelease.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.kohsuke.github;
22

3+
import edu.umd.cs.findbugs.annotations.Nullable;
34
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
45

56
import java.io.File;
@@ -157,8 +158,13 @@ public boolean isPrerelease() {
157158
*
158159
* @return the published at
159160
*/
161+
@Nullable
160162
public Date getPublished_at() {
161-
return new Date(published_at.getTime());
163+
if (published_at != null) {
164+
return new Date(published_at.getTime());
165+
} else {
166+
return null;
167+
}
162168
}
163169

164170
/**

0 commit comments

Comments
 (0)