diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/SafeMarshalCopy.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/SafeMarshalCopy.cs index c3674efb8..1e33d8324 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/SafeMarshalCopy.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/SafeMarshalCopy.cs @@ -21,7 +21,7 @@ namespace UniGLTF /// public static void CopyBytesToArray(ArraySegment src, T[] dst) where T : struct { - if (src.Array == null || dst == null) + if (src.Array == null || dst == null || src.Count == 0) { throw new System.ArgumentNullException(); } @@ -50,7 +50,7 @@ namespace UniGLTF /// public static void CopyArrayToToBytes(T[] src, ArraySegment dst) where T : struct { - if (dst.Array == null || src == null) + if (dst.Array == null || src == null || dst.Count == 0) { throw new System.ArgumentNullException(); }