We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0454c7b commit 46e2162Copy full SHA for 46e2162
src/TensorFlowNET.Core/APIs/c_api.cs
@@ -53,6 +53,11 @@ public static string StringPiece(IntPtr handle)
53
54
public unsafe static byte[] ByteStringPiece(IntPtr handle)
55
{
56
+ if (handle == IntPtr.Zero)
57
+ {
58
+ return new byte[0];
59
+ }
60
+
61
byte* str_data = (byte*)handle.ToPointer();
62
List<byte> bytes = new List<byte>();
63
byte current = 255;
0 commit comments