mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 19:49:15 +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;
|
|
}
|
|
}
|
|
}
|
|
}
|