Skip to content

Commit a1fca3a

Browse files
committed
fix potential NPE
in case somebody calls getFormattedDate before setDate() was called
1 parent f916646 commit a1fca3a

File tree

1 file changed

+4
-1
lines changed
  • bundles/org.eclipse.ui.views.log/src/org/eclipse/ui/internal/views/log

1 file changed

+4
-1
lines changed

bundles/org.eclipse.ui.views.log/src/org/eclipse/ui/internal/views/log/LogSession.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public Date getDate() {
5353
*/
5454
public String getFormattedDate() {
5555
if (fDateString == null) {
56-
fDateString = LOCAL_SDF.format(getDate().toInstant());
56+
Date tmpdate = getDate();
57+
if (tmpdate != null) {
58+
fDateString = LOCAL_SDF.format(tmpdate.toInstant());
59+
}
5760
}
5861
return fDateString;
5962
}

0 commit comments

Comments
 (0)