mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:52:56 +08:00
Gracefully handle undefined DateTimeOffset
values
Only seems to happen in tests, but best to safeguard against this regardless.
This commit is contained in:
parent
3d0caa44c8
commit
2f6e65a9a2
@ -58,6 +58,9 @@ namespace osu.Game.Extensions
|
||||
/// <returns>A short relative string representing the input time.</returns>
|
||||
public static string ToShortRelativeTime(this DateTimeOffset time, TimeSpan lowerCutoff)
|
||||
{
|
||||
if (time == default)
|
||||
return "-";
|
||||
|
||||
var now = DateTime.Now;
|
||||
var difference = now - time;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user