From be912769d7c9ba45556f416074e3e42819cf3108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E7=85=9C?= Date: Wed, 2 Oct 2019 15:04:40 +0800 Subject: [PATCH] Fix eagle refresh instance Npe --- .../Source/core/bridge/platform/core_side_in_platform.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp index 34d1e49d29..710ce35c0d 100644 --- a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp +++ b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp @@ -388,10 +388,9 @@ int CoreSideInPlatform::RefreshInstance( }} } }; - - auto final_json_str = final_json.dump().c_str(); - auto utf16_key = weex::base::to_utf16(const_cast(final_json_str), - strlen(final_json_str)); + std::string out = final_json.dump(); + auto utf16_key = weex::base::to_utf16(const_cast(out.c_str()), + out.length()); args->value.string = genWeexString( reinterpret_cast(utf16_key.c_str()), utf16_key.size()); msg.push_back(args);