mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 12:09:18 +08:00
23 lines
465 B
C#
23 lines
465 B
C#
using System;
|
|
|
|
namespace Wox.Infrastructure
|
|
{
|
|
static class Helper
|
|
{
|
|
/// <summary>
|
|
/// http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
|
|
/// </summary>
|
|
public static T RequireNonNull<T>(this T obj)
|
|
{
|
|
if (obj == null)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
else
|
|
{
|
|
return obj;
|
|
}
|
|
}
|
|
}
|
|
}
|