Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Fix npe (#2842)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darin726 authored and lucky-chen committed Aug 21, 2019
1 parent 5bce92c commit f64a866
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ static std::unique_ptr<IPCResult> HandleReportException(
}

WeexCoreManager::Instance()->script_thread()->message_loop()->PostTask(
weex::base::MakeCopyable([pageId = std::string(pageId),
funcS = std::string(func),
exceptionStr = std::string(exceptionInfo)] {
weex::base::MakeCopyable([pageId = std::string(pageId == nullptr ? "" : pageId),
funcS = std::string(func == nullptr ? "" : func),
exceptionStr = std::string(exceptionInfo == nullptr ? "" : exceptionInfo)] {
WeexCoreManager::Instance()
->script_bridge()
->core_side()
Expand Down
3 changes: 2 additions & 1 deletion weex_core/Source/android/jsengine/weex_jsc_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ void ReportException(JSGlobalObject *_globalObject, Exception *exception, const
CString data = exceptionInfo.utf8();

auto *globalObject = static_cast<WeexGlobalObject *>(_globalObject);
globalObject->js_bridge()->core_side()->ReportException(instanceid, func, data.data());
const char *exception_char = data.data();
globalObject->js_bridge()->core_side()->ReportException(instanceid, func, exception_char == nullptr? "" : exception_char);
}


Expand Down

0 comments on commit f64a866

Please sign in to comment.