Browse Source

Allow null array to be implictly casted to Span

disarray2077 4 years ago
parent
commit
607cca1431
1 changed files with 3 additions and 0 deletions
  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);
 		}