aboutsummaryrefslogtreecommitdiffstatsci
path: root/vulkan/Utf8StringPointer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'vulkan/Utf8StringPointer.cs')
-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();