commit | 4ae57e183d8a4763233297cba19ddd93bec760ef | [log] [tgz] |
---|---|---|
author | Jim Blackler <jimblackler@google.com> | Thu Oct 10 18:09:13 2024 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Oct 10 18:09:13 2024 +0000 |
tree | 3fd897abae14989f6461646d3cc473f9f616add1 | |
parent | 701e4f53d991155aae81ed6e201ee1665321d7ff [diff] |
Fix for logic error in nullable string converter that can cause a crash. Test: Manual Change-Id: I10771e6eb45e76b210722c9f8a800a39b0d89bc9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/210494 Reviewed-by: Alex Benton <bentonian@google.com> Commit-Queue: Alex Benton <bentonian@google.com>
diff --git a/generator/templates/art/structures.cpp b/generator/templates/art/structures.cpp index 2f6f6f8..2848018 100644 --- a/generator/templates/art/structures.cpp +++ b/generator/templates/art/structures.cpp
@@ -94,6 +94,7 @@ void ToNative(JNIContext* c, JNIEnv* env, jstring obj, WGPUStringView* s) { if (obj == nullptr) { *s = {nullptr, WGPU_STRLEN}; + return; } *s = {c->GetStringUTFChars(obj), static_cast<size_t>(env->GetStringUTFLength(obj))}; }