User and colors can not be null in UserPanel.cs

This commit is contained in:
Miterosan 2017-11-07 22:51:06 +01:00
parent 2518b5e9a0
commit e430256b09
1 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,9 @@ public class UserPanel : ClickableContainer, IHasContextMenu
public UserPanel(User user)
{
if (user == null)
throw new ArgumentNullException(nameof(user));
this.user = user;
Height = height - status_height;
@ -173,6 +176,9 @@ public UserPanel(User user)
[BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuColour colours, UserProfileOverlay profile)
{
if (colours == null)
throw new ArgumentNullException(nameof(colours));
Status.ValueChanged += displayStatus;
Status.ValueChanged += status => statusBg.FadeColour(status?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint);