1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Make year nullable rather than defaulting to zero

This commit is contained in:
Dean Herbert 2021-05-20 15:23:49 +09:00
parent d4530313aa
commit 9267d23dc2
2 changed files with 4 additions and 4 deletions

View File

@ -8,10 +8,10 @@ namespace osu.Game.Online.API.Requests
{
public class GetNewsRequest : APIRequest<GetNewsResponse>
{
private readonly int year;
private readonly int? year;
private readonly Cursor cursor;
public GetNewsRequest(int year = 0, Cursor cursor = null)
public GetNewsRequest(int? year = null, Cursor cursor = null)
{
this.year = year;
this.cursor = cursor;
@ -22,8 +22,8 @@ namespace osu.Game.Online.API.Requests
var req = base.CreateWebRequest();
req.AddCursor(cursor);
if (year != 0)
req.AddParameter("year", year.ToString());
if (year.HasValue)
req.AddParameter("year", year.Value.ToString());
return req;
}