From 72270825c1b82f3bcf58d50ac1753b350ef0205e Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 3 Feb 2019 09:48:57 -0500 Subject: [PATCH] Prevent segmentation fault when resetprop is unsupported --- native/jni/resetprop/resetprop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/resetprop/resetprop.cpp b/native/jni/resetprop/resetprop.cpp index 92bec3780..37ab10fa3 100644 --- a/native/jni/resetprop/resetprop.cpp +++ b/native/jni/resetprop/resetprop.cpp @@ -129,7 +129,7 @@ int prop_exist(const char *name) { // Get prop by name, return string string getprop(const char *name, bool persist) { if (!check_legal_property_name(name) || init_resetprop()) - return nullptr; + return string(); const prop_info *pi = __system_property_find(name); if (pi == nullptr) { if (persist && strncmp(name, "persist.", 8) == 0) {