1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Mark properties as [CanBeNull]

This commit is contained in:
Bartłomiej Dach 2020-03-21 14:35:04 +01:00
parent ce47617476
commit d167e0c8b9
2 changed files with 4 additions and 1 deletions

View File

@ -4,12 +4,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using static osu.Game.Users.User;
namespace osu.Game.Overlays.Profile.Sections.Historical
{
public class UserHistoryGraph : UserGraph<DateTime, long>
{
[CanBeNull]
public UserHistoryCount[] Values
{
set => Data = value?.Select(v => new KeyValuePair<DateTime, long>(v.Date, v.Count)).ToArray();

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -79,11 +80,11 @@ namespace osu.Game.Overlays.Profile
/// <summary>
/// Set of values which will be used to create a graph.
/// </summary>
[CanBeNull]
protected KeyValuePair<TKey, TValue>[] Data
{
set
{
value ??= Array.Empty<KeyValuePair<TKey, TValue>>();
data = value;
redrawGraph();
}