Texture in Avatar.cs can not be null.

This commit is contained in:
Miterosan 2017-11-07 22:49:32 +01:00
parent 3761df249f
commit e417eceb98
1 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -25,6 +26,9 @@ public Avatar(User user = null)
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
if (textures == null)
throw new ArgumentNullException(nameof(textures));
Texture texture = null;
if (user != null && user.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
if (texture == null) texture = textures.Get(@"Online/avatar-guest");