resolve merge conflicts of 1a3ac02 to nyc-dev-plus-aosp
am: d4e38524c3
* commit 'd4e38524c3a252204113c12322f9e4b8e765622d':
nativeloader: Fix the case of search_path == null
Change-Id: I7b114a4efc1c0a58e5ed326f0d85bf2235c10281
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index 7abc2c3..5c1db5b 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -56,7 +56,12 @@
jstring java_library_path,
jstring java_permitted_path,
int32_t target_sdk_version) {
- ScopedUtfChars library_path(env, java_library_path);
+ std::string library_path; // empty string by default.
+
+ if (java_library_path != nullptr) {
+ ScopedUtfChars library_path_utf_chars(env, java_library_path);
+ library_path = library_path_utf_chars.c_str();
+ }
std::string permitted_path;
if (java_permitted_path != nullptr) {