mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-13 03:34:55 +08:00
16 lines
419 B
C#
16 lines
419 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BetterLyrics.WinUI3.Helper {
|
|
public static class CollectionHelper {
|
|
public static T? SafeGet<T>(this IList<T> list, int index) {
|
|
if (list == null || index < 0 || index >= list.Count)
|
|
return default;
|
|
return list[index];
|
|
}
|
|
}
|
|
}
|