list can not be null in ControlPointInfo.cs

This commit is contained in:
Miterosan 2017-11-07 23:08:24 +01:00
parent e430256b09
commit 840946d160
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 System.Collections.Generic;
using System.Linq;
using osu.Framework.Lists;
@ -85,6 +86,9 @@ public class ControlPointInfo
private T binarySearch<T>(SortedList<T> list, double time, T prePoint = null)
where T : ControlPoint, new()
{
if (list == null)
throw new ArgumentNullException(nameof(list));
if (list.Count == 0)
return new T();