浏览代码

Allow null array to be implictly casted to Span

disarray2077 4 年之前
父节点
当前提交
607cca1431
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      BeefLibs/corlib/src/Span.bf

+ 3 - 0
BeefLibs/corlib/src/Span.bf

@@ -48,6 +48,9 @@ namespace System
 
 		public static implicit operator Span<T> (T[] array)
 		{
+			if (array == null)
+				return default;
+			
 			return Span<T>(array);
 		}