From 17708418069d84fb4cc8ad5cf12946681f4d3a1f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Fri, 10 Dec 2021 04:09:47 +0100 Subject: test ptr null in utf8stringpointer --- vulkan/Utf8StringPointer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vulkan/Utf8StringPointer.cs b/vulkan/Utf8StringPointer.cs index e75fd64..0bb9742 100644 --- a/vulkan/Utf8StringPointer.cs +++ b/vulkan/Utf8StringPointer.cs @@ -13,7 +13,10 @@ namespace Vulkan handle = ptr; } Utf8StringPointer (string str) { - handle = str.PinPointer(); + if (string.IsNullOrEmpty(str)) + handle = IntPtr.Zero; + else + handle = str.PinPointer(); } public static implicit operator string (Utf8StringPointer pt) => pt.ToString(); -- cgit v1.3.1-4-g156e