aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-10 04:09:47 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-10 04:09:47 +0100
commit17708418069d84fb4cc8ad5cf12946681f4d3a1f (patch)
tree3c3821a4416c50262ac219c28ed2830d08572e84
parentb8051560dbadef834062037283f1d8de32522296 (diff)
test ptr null in utf8stringpointer
-rw-r--r--vulkan/Utf8StringPointer.cs5
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();