diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-12-10 04:09:47 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-12-10 04:09:47 +0100 |
| commit | 17708418069d84fb4cc8ad5cf12946681f4d3a1f (patch) | |
| tree | 3c3821a4416c50262ac219c28ed2830d08572e84 | |
| parent | b8051560dbadef834062037283f1d8de32522296 (diff) | |
test ptr null in utf8stringpointer
| -rw-r--r-- | vulkan/Utf8StringPointer.cs | 5 |
1 files changed, 4 insertions, 1 deletions
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(); |