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:
parent
d4530313aa
commit
9267d23dc2
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user