summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/jvpp-common/string_t.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/java/jvpp-common/string_t.h b/java/jvpp-common/string_t.h
index 8a2b3cc..adfcde9 100644
--- a/java/jvpp-common/string_t.h
+++ b/java/jvpp-common/string_t.h
@@ -27,6 +27,7 @@
// */
static size_t jstr_length(JNIEnv *env, jstring string)
{
+ if (string == NULL) return 0;
return ((int) (*env)->GetStringUTFLength(env, string));
}